Module pl.file
File manipulation functions: reading, writing, moving and copying.
This module wraps a number of functions from other modules into a file related module for convenience.
Dependencies: `pl.utils`, `pl.dir`, `pl.path`
Functions
| read () | return the contents of a file as a string. |
| write () | write a string to a file. |
| copy () | copy a file. |
| move () | move a file. |
| access_time () | Return the time of last access as the number of seconds since the epoch. |
| creation_time () | Return when the file was created. |
| modified_time () | Return the time of last modification. |
| delete () | Delete a file. |
Functions
- read ()
- return the contents of a file as a string. This function is a copy of `utils.readfile`.
- write ()
- write a string to a file. This function is a copy of `utils.writefile`.
- copy ()
- copy a file. This function is a copy of `dir.copyfile`.
- move ()
- move a file. This function is a copy of `dir.movefile`.
- access_time ()
- Return the time of last access as the number of seconds since the epoch. This function is a copy of `path.getatime`.
- creation_time ()
- Return when the file was created. This function is a copy of `path.getctime`.
- modified_time ()
- Return the time of last modification. This function is a copy of `path.getmtime`.
- delete ()
- Delete a file. This function is a copy of `os.remove`.