Javascript File: Difference between revisions
Created page with "Javascript File object. == Static methods == * '''exists(path)''' Check if a file or directory exists<br> Parameters:<br> '''path''': Path to check<br> Return:<br> TRUE if f..." |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 25: | Line 25: | ||
TRUE on success, FALSE on failure<br> | TRUE on success, FALSE on failure<br> | ||
* '''mkdir(path)''' | * '''mkdir(path [,mode])''' | ||
Create a directory<br> | Create a directory<br> | ||
Parameters:<br> | Parameters:<br> | ||
'''path''': Directory path<br> | '''path''': Directory path<br> | ||
'''mode''': Optional directory permissions (integer mask, ignored on Windows)<br> | |||
Return:<br> | Return:<br> | ||
TRUE on success, FALSE on failure<br> | TRUE on success, FALSE on failure<br> | ||
| Line 53: | Line 54: | ||
Return:<br> | Return:<br> | ||
TRUE on success, FALSE on failure<br> | TRUE on success, FALSE on failure<br> | ||
* '''listDirectory(path[,params])''' | |||
Set file last change time<br> | |||
Parameters:<br> | |||
'''path''': Directory path<br> | |||
'''params''': Listing parameters (object)<br> | |||
'''params''' properties:<br> | |||
'''list_file''': Boolean. List files<br> | |||
'''list_dir''': Boolean. List directories<br> | |||
Files are listed by default. ''list_dir'' is ignored unless ''list_file'' is disabled.<br> | |||
Return:<br> | |||
Array of strings on success, null on failure<br> | |||
Latest revision as of 11:17, 8 March 2022
Javascript File object.
Static methods
- exists(path)
Check if a file or directory exists
Parameters:
path: Path to check
Return:
TRUE if found, FALSE if not
- remove(path)
Remove specified file
Parameters:
path: File path
Return:
TRUE on success, FALSE on failure
- rename(oldName,newName)
Rename (or move) a file
Parameters:
oldName: Path to file to rename or move
newName: Path to new file name
Return:
TRUE on success, FALSE on failure
- mkdir(path [,mode])
Create a directory
Parameters:
path: Directory path
mode: Optional directory permissions (integer mask, ignored on Windows)
Return:
TRUE on success, FALSE on failure
- rmdir(path)
Remove specified directory
Parameters:
path: Directory to remove
Return:
TRUE on success, FALSE on failure
- getFileTime(path)
Retrieve file last change time
Parameters:
path: File path
Return:
File last change time in seconds since EPOCH, -1 on failure
- setFileTime(path,time)
Set file last change time
Parameters:
path: File path
time: File time in seconds since EPOCH
Return:
TRUE on success, FALSE on failure
- listDirectory(path[,params])
Set file last change time
Parameters:
path: Directory path
params: Listing parameters (object)
params properties:
list_file: Boolean. List files
list_dir: Boolean. List directories
Files are listed by default. list_dir is ignored unless list_file is disabled.
Return:
Array of strings on success, null on failure