Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Globally available file related functions
Used to perform typical operations with it.
More...
Functions | |
bool ATTR_DLL_LOCAL | kodi::vfs::FileExists (const std::string &filename, bool usecache=false) |
Check if a file exists. | |
bool ATTR_DLL_LOCAL | kodi::vfs::StatFile (const std::string &filename, kodi::vfs::FileStatus &buffer) |
Get file status. | |
bool ATTR_DLL_LOCAL | kodi::vfs::DeleteFile (const std::string &filename) |
Deletes a file. | |
bool ATTR_DLL_LOCAL | kodi::vfs::RenameFile (const std::string &filename, const std::string &newFileName) |
Rename a file name. | |
bool ATTR_DLL_LOCAL | kodi::vfs::CopyFile (const std::string &filename, const std::string &destination) |
Copy a file from source to destination. | |
Globally available file related functions
Used to perform typical operations with it.
|
inline |
Copy a file from source to destination.
[in] | filename | The filename to copy. |
[in] | destination | The destination to copy file to |
|
inline |
Deletes a file.
[in] | filename | The filename to delete. |
Example:
|
inline |
Check if a file exists.
[in] | filename | The filename to check. |
[in] | usecache | Check in file cache. |
Example:
|
inline |
Rename a file name.
[in] | filename | The filename to copy. |
[in] | newFileName | The new filename |
|
inline |
Get file status.
These function return information about a file. Execute (search) permission is required on all of the directories in path that lead to the file.
The call return a stat structure, which contains the on class FileStatus defined values.
[in] | filename | The filename to read the status from. |
[out] | buffer | The file status is written into this buffer. |
The following table contains values that can be set with class FileStatus :
Name | Type | Set call | Get call |
---|---|---|---|
ID of device containing file | uint32_t | SetDeviceId | GetDeviceId |
Represent file serial numbers | uint64_t | SetFileSerialNumber | GetFileSerialNumber |
Total size, in bytes | uint64_t | SetSize | GetSize |
Time of last access | time_t | SetAccessTime | GetAccessTime |
Time of last modification | time_t | SetModificationTime | GetModificationTime |
Time of last status change | time_t | SetStatusTime | GetStatusTime |
Stat url is a directory | bool | SetIsDirectory | GetIsDirectory |
Stat url as a symbolic link | bool | SetIsSymLink | GetIsSymLink |
Stat url as a block special | bool | SetIsBlock | GetIsBlock |
Stat url as a character special | bool | SetIsCharacter | GetIsCharacter |
Stat url as a FIFO special | bool | SetIsFifo | GetIsFifo |
Stat url as a regular | bool | SetIsRegular | GetIsRegular |
Stat url as a socket | bool | SetIsSocket | GetIsSocket |
Example: