Virtual file system functions on Kodi.
More...
|
| File |
| Kodi's file class.
|
|
| Stat |
| Get file or file system status.
|
|
Virtual file system functions on Kodi.
Offers classes and functions offers access to the Virtual File Server (VFS) which you can use to manipulate files and folders.
◆ copy()
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.copy(source, destination) </big></font></span></code></h4> \endhtmlonly
Copy file to destination, returns true/false.
- Parameters
-
source | file to copy. |
destination | destination file |
- Returns
- True if successed
Example:
..
success = xbmcvfs.copy(source, destination)
..
◆ delete()
Delete a file.
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.delete(file) </big></font></span></code></h4> \endhtmlonly
- Parameters
-
- Returns
- True if successed
Example:
..
xbmcvfs.delete(file)
..
◆ exists()
Check for a file or folder existence.
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.exists(path) </big></font></span></code></h4> \endhtmlonly
- Parameters
-
path | File or folder (folder must end with slash or backslash) |
- Returns
- True if successed
Example:
..
success = xbmcvfs.exists(path)
..
◆ listdir()
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.listdir(path) </big></font></span></code></h4> \endhtmlonly
Lists content of a folder.
- Parameters
-
path | Folder to get list from |
- Returns
- Directory content list
Example:
..
dirs, files = xbmcvfs.listdir(path)
..
◆ mkdir()
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.mkdir(path) </big></font></span></code></h4> \endhtmlonly
Create a folder.
- Parameters
-
- Returns
- True if successed
Example:
..
success = xbmcvfs.mkdir(path)
..
◆ mkdirs()
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.mkdirs(path) </big></font></span></code></h4> \endhtmlonly
Make all directories along the path
Create folder(s) - it will create all folders in the path.
- Parameters
-
- Returns
- True if successed
Example:
..
success = xbmcvfs.mkdirs(path)
..
◆ rename()
Rename a file.
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.rename(file, newFileName) </big></font></span></code></h4> \endhtmlonly
- Parameters
-
file | File to rename |
newFileName | New filename, including the full path |
- Returns
- True if successed
- Note
- Moving files between different filesystem (eg. local to nfs://) is not possible on all platforms. You may have to do it manually by using the copy and deleteFile functions.
Example:
..
success = xbmcvfs.rename(file,newFileName)
..
◆ rmdir()
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> xbmcvfs.rmdir(path) </big></font></span></code></h4> \endhtmlonly
Remove a folder.
- Parameters
-
- Returns
- True if successed
Example:
..
success = xbmcvfs.rmdir(path)
..