Tables
disk
This table gives access to the disks
Functions
list()Returns index table of connected drivesget_info(index)Returns table, containing drive information Table keys:size- Drive size, bytesused_space- Used space, bytesused_space_precentage- Used space, percentagesname- Drive name
Examples
1 2 3 4 5 6 | |
file
This table gives access to the files
Methods
exists(disk_id, pathReturnsbooleanread_bytes(disk_id, path)Returns byte tablewrite_bytes(disk_id, path, table_of_bytes)read_text(disk_id, path)Returnsstringwrite_text(disk_id, path, text)read_lines(disk_id, path)Returns string tablewrite_lines(disk_id, path, table_of_strings)delete(disk_id, path)create(disk_id, path)Returnsfile meta tableget_meta(disk_id, path)Returnsfile meta tablemove(disk_od, path, target_path)copy(disk_od, path, target_path)
file meta table keys
path- Absolute file pathsize- File size, bytesmodified- Date and time of the last modification in UNIX (seconds)created- Date and time of the file creation in UNIX (seconds)owner- File owner
directory
This table gives access to the directories
Methods
exists(disk_id, path)Returnsbooleancreate(disk_id, path)Returnsdirectory meta tableget_meta(disk_id, path)Returnsdirectory meta tabledelete(disk_id, path)move(disk_od, path, target_path)copy(disk_od, path, target_path)get_files(disk_id, path)Returns string tableget_directories(disk_id, path)Returns string table
directory meta table keys
path- Absolute file pathmodified- Date and time of the last modification in UNIX (seconds)created- Date and time of the file creation in UNIX (seconds)owner- File owner
Global functions
Get_file_name(path)- Returns file name with the extensionGet_directory_name(path)- Returns directory nameCombine_paths(table of paths)- Combines the paths into oneGet_parent_directory(path)- Returns parent directory