Module pl.file
File Operations: copy,move,reading,writing
Functions
access_time (path) | Return the time of last access as the number of seconds since the epoch. |
copy (src, dest, flag) | copy a file. |
creation_time (path) | Return when the file was created. |
delete (path) | Delete a file |
modified_time (path) | Return the time of last modification |
move (src, dest) | move a file. |
read (filename) | return the contents of a file as a string |
write (filename, str) | write a string to a file |
Functions
- access_time (path)
-
Return the time of last access as the number of seconds since the epoch.
Parameters:
-
path
: A file path
-
- copy (src, dest, flag)
-
copy a file.
Parameters:
-
src
: source file -
dest
: destination file -
flag
: true if you want to force the copy (default)
Return value:
- true if operation succeeded
-
- creation_time (path)
-
Return when the file was created.
Parameters:
-
path
: A file path
-
- delete (path)
-
Delete a file
Parameters:
-
path
: A file path
-
- modified_time (path)
-
Return the time of last modification
Parameters:
-
path
: A file path
-
- move (src, dest)
-
move a file.
Parameters:
-
src
: source file -
dest
: destination file
Return value:
- true if operation succeeded
-
- read (filename)
-
return the contents of a file as a string
Parameters:
-
filename
: The file path
Return value:
- file contents
-
- write (filename, str)
-
write a string to a file
Parameters:
-
filename
: The file path -
str
: The string
-