File Browser¶
Table of Contents
List¶
-
FileBrowser.
ls
(path) Execute ls on the provided path
Parameters: path (str) – Path to execute ls on
file_browser.ls('')
file_browser.ls('My Files')
-
FileBrowser.
walk
(path) Perform walk on the provided path
Parameters: path (str) – Path to perform walk on
file_browser.walk('My Files')
Download¶
-
FileBrowser.
download
(path) Download a file
Parameters: path (str) – Path of the file to download
file_browser.download('My Files/Documents/Sample.docx')
Create Directory¶
-
FileBrowser.
mkdir
(path, recurse=False) Create a new directory
Parameters: - path (str) – Path of the directory to create
- recurse (bool,optional) – Whether to create the path recursivly, defaults to False
file_browser.mkdir('My Files/Documents')
file_browser.mkdir('The/quick/brown/fox', recurse = True)
Rename¶
-
FileBrowser.
rename
(path, name) Rename a file
Parameters: - path (str) – Path of the file or directory to rename
- name (str) – The name to rename to
file_browser.rename('My Files/Documents/Sample.docx', 'Wizard Of Oz.docx')
Delete¶
-
FileBrowser.
delete
(path) Delete a file
Parameters: path (str) – Path of the file or directory to delete
file_browser.delete('My Files/Documents/Sample.docx')
-
FileBrowser.
delete_multi
(*args) Delete multiple files and/or directories
Parameters: *args – Variable lengthed list of paths of files and/or directories to delete
file_browser.delete_multi('My Files/Documents/Sample.docx', 'The/quick/brown/fox')
Recover¶
-
FileBrowser.
undelete
(path) Restore a previously deleted file or directory
Parameters: path (str) – Path of the file or directory to restore
file_browser.undelete('My Files/Documents/Sample.docx')
-
FileBrowser.
undelete_multi
(*args) Restore previously deleted multiple files and/or directories
Parameters: *args – Variable length list of paths of files and/or directories to restore
file_browser.undelete_multi('My Files/Documents/Sample.docx', 'The/quick/brown/fox')
Copy¶
-
FileBrowser.
copy
(src, dest) Copy a file or directory
Parameters: - src (str) – The source path of the file or directory
- dst (str) – The destination path of the file or directory
file_browser.copy('My Files/Documents/Sample.docx', 'The/quick/brown/fox')
-
FileBrowser.
copy_multi
(src, dest)
file_browser.copy_multi(['My Files/Documents/Sample.docx', 'My Files/Documents/Burndown.xlsx'], 'The/quick/brown/fox')
Move¶
-
FileBrowser.
move
(src, dest) Move a file or directory
Parameters: - src (str) – The source path of the file or directory
- dst (str) – The destination path of the file or directory
file_browser.move('My Files/Documents/Sample.docx', 'The/quick/brown/fox')
-
FileBrowser.
move_multi
(src, dest)
file_browser.move_multi(['My Files/Documents/Sample.docx', 'My Files/Documents/Burndown.xlsx'], 'The/quick/brown/fox')
Create Public Link¶
-
FileBrowser.
mklink
(path, access='RO', expire_in=30) Create a link to a file
Parameters: - path (str) – The path of the file to create a link to
- access (str,optional) – Access policy of the link, defaults to ‘RO’
- expire_in (int,optional) – Number of days until the link expires, defaults to 30
"""
Access:
- RW: Read Write
- RO: Read Only
- NA: No Access
"""
"""Create a Read Only public link to a file that expires in 30 days"""
file_browser.mklink('My Files/Documents/Sample.docx')
"""Create a Read Write public link to a folder that expires in 45 days"""
file_browser.mklink('My Files/Documents/Sample.docx', 'RW', 45)
Warning
you cannot use this tool to create read write public links to files.