|
libdsm 0.4.3
Minimalist and read-only SMB client lib
|
File status / listing. More...
Macros | |
| #define | SMB_STAT_SIZE 0 |
| smb_stat_get() OP: Get file size | |
| #define | SMB_STAT_ALLOC_SIZE 1 |
| smb_stat_get() OP: Get file allocation size (Size on disk) | |
| #define | SMB_STAT_ISDIR 2 |
| smb_stat_get() OP: 0 -> not a directory, != 0 -> directory | |
| #define | SMB_STAT_CTIME 3 |
| smb_stat_get() OP: Get file creation time | |
| #define | SMB_STAT_ATIME 4 |
| smb_stat_get() OP: Get file last access time | |
| #define | SMB_STAT_WTIME 5 |
| smb_stat_get() OP: Get file last write time | |
| #define | SMB_STAT_MTIME 6 |
| smb_stat_get() OP: Get file last moditification time | |
Functions | |
| BDSM_EXPORT smb_stat_list | smb_find (smb_session *s, smb_tid tid, const char *pattern) |
| Returns infos about files matching a pattern. | |
| BDSM_EXPORT smb_stat | smb_fstat (smb_session *s, smb_tid tid, const char *path) |
| Get the status of a file from it's path inside of a share. | |
| BDSM_EXPORT smb_stat | smb_stat_fd (smb_session *s, smb_fd fd) |
| Get the status of an open file from it's file descriptor. | |
| BDSM_EXPORT void | smb_stat_destroy (smb_stat stat) |
| Clear a smb_stat object, reclaiming its memory. | |
| BDSM_EXPORT size_t | smb_stat_list_count (smb_stat_list list) |
| Get the number of item in a smb_stat_list file info. | |
| BDSM_EXPORT smb_stat | smb_stat_list_at (smb_stat_list list, size_t index) |
| Get the element at the given position. | |
| BDSM_EXPORT void | smb_stat_list_destroy (smb_stat_list list) |
| Destroy and release a list of file stat returned by smb_find. | |
| BDSM_EXPORT const char * | smb_stat_name (smb_stat info) |
| Get the name of the file from its status. | |
| BDSM_EXPORT uint64_t | smb_stat_get (smb_stat info, int what) |
| Get a file attribute. | |
File status / listing.
| BDSM_EXPORT smb_stat_list smb_find | ( | smb_session * | s, |
| smb_tid | tid, | ||
| const char * | pattern ) |
Returns infos about files matching a pattern.
This functions uses the FIND_FIRST2 SMB operations to list files matching a certain pattern. It's basically used to list folder contents
| s | The session object |
| tid | The share inside of which we want to find files obtained by smb_tree_connect() |
| pattern | The pattern to match files. '\*' will list all the files at the root of the share. '\afolder\*' will list all the files inside of the 'afolder' directory. |
| BDSM_EXPORT smb_stat smb_fstat | ( | smb_session * | s, |
| smb_tid | tid, | ||
| const char * | path ) |
Get the status of a file from it's path inside of a share.
| s | The session object |
| tid | The tree id of a share obtained by smb_tree_connect() |
| path | The full path of the file relative to the root of the share (e.g. '\folder\file.ext') |
| BDSM_EXPORT void smb_stat_destroy | ( | smb_stat | stat | ) |
| BDSM_EXPORT smb_stat smb_stat_fd | ( | smb_session * | s, |
| smb_fd | fd ) |
Get the status of an open file from it's file descriptor.
The file status will be those at the time of open
| s | The session object |
| fd | The smb_fd from which you want infos/status |
| BDSM_EXPORT uint64_t smb_stat_get | ( | smb_stat | info, |
| int | what ) |
Get a file attribute.
This function is a getter that allow you to retrieve various informations about a file on a smb_stat object. You can get its size, various timestamps, etc.
| info | The smb_stat object to get info from. |
| what | This parameter tells the functions which information to get, can be one of SMB_STAT_SIZE, SMB_STAT_ALLOC_SIZE, SMB_STAT_ISDIR, SMB_STAT_CTIME, SMB_STAT_ATIME, SMB_STAT_MTIME, SMB_STAT_WTIME. |
| BDSM_EXPORT smb_stat smb_stat_list_at | ( | smb_stat_list | list, |
| size_t | index ) |
Get the element at the given position.
| list | A stat list |
| index | The position of the element you want. |
| BDSM_EXPORT size_t smb_stat_list_count | ( | smb_stat_list | list | ) |
Get the number of item in a smb_stat_list file info.
| list | The list you want the length of |
| BDSM_EXPORT void smb_stat_list_destroy | ( | smb_stat_list | list | ) |
Destroy and release a list of file stat returned by smb_find.
| list | The stat_list to free |
| BDSM_EXPORT const char * smb_stat_name | ( | smb_stat | info | ) |
Get the name of the file from its status.
| info | A file status |