File status / listing.
More...
|
#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
|
|
◆ smb_find()
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
- Parameters
-
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. |
- Returns
- An opaque list of smb_stat or NULL in case of error
◆ smb_fstat()
Get the status of a file from it's path inside of a share.
- Parameters
-
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') |
- Returns
- An opaque smb_stat or NULL in case of error. You need to destory this object with smb_stat_destroy after usage.
◆ smb_stat_destroy()
BDSM_EXPORT void smb_stat_destroy |
( |
smb_stat |
stat | ) |
|
Clear a smb_stat object, reclaiming its memory.
- Parameters
-
stat | A smb_stat object returned by smb_fstat. |
◆ smb_stat_fd()
Get the status of an open file from it's file descriptor.
The file status will be those at the time of open
- Parameters
-
s | The session object |
fd | The smb_fd from which you want infos/status |
- Returns
- An opaque smb_stat or NULL in case of error. You don't own this object memory, and then don't have to destory it
◆ smb_stat_get()
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.
- Parameters
-
- Returns
- The meaning of the returned value depends on the 'what' parameter. See each item documentation.
◆ smb_stat_list_at()
Get the element at the given position.
- Parameters
-
list | A stat list |
index | The position of the element you want. |
- Returns
- An opaque smb_stat or NULL in case of error
◆ smb_stat_list_count()
Get the number of item in a smb_stat_list file info.
- Parameters
-
list | The list you want the length of |
- Returns
- The length of the list. It returns 0 if the list is invalid
◆ smb_stat_list_destroy()
Destroy and release a list of file stat returned by smb_find.
- Parameters
-
list | The stat_list to free |
◆ smb_stat_name()
BDSM_EXPORT const char * smb_stat_name |
( |
smb_stat |
info | ) |
|
Get the name of the file from its status.
- Parameters
-
- Returns
- A null-terminated string in you current locale encoding or NULL.