Module file_util

Source

Structs§

PathIOError

Functions§

create_dir_if_not_exists
open_append
Open a file for writing in append mode, without truncating it if it exists, but creating it if it doesn’t exist. E.g. for writing logs.
open_rw
Open a file for reading and writing, without truncating it if it exists, but creating it if it doesn’t exist. The filehandle is in append mode (XX is it?, only on Unix?). You can use this to open a file that you intend to mutate, but need to flock first (i.e. can’t truncate before you’ve got the lock).