Creates any missing parent directories of path.
Equations
- Lake.createParentDirs path = match path.parent with | some dir => IO.FS.createDirAll dir | x => pure ()
Instances For
Remove the file at path if it exists.
Equations
- Lake.removeFileIfExists path = tryCatch (IO.FS.removeFile path) fun (x : IO.Error) => match x with | IO.Error.noFileOrDirectory filename osCode details => pure () | e => throw e
Instances For
Write the UTF-8 encoded string content to path.
If the file already exists, does nothing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Write the bytes of content to path.
If the file already exists, does nothing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Produces a file at path with its full content in one atomic operation.
To do so, it writes the content to .part.tmp file and then renames it to the destination.
If the file already exists, it will be left as-is.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remove a directory and all its contents.
Like IO.FS.removeDirAll, but does not fail if path does not exist
or if a file is first deleted by a racing process.
Copy a file from src to dst.
Equations
- Lake.copyFile src dst = do let contents ← IO.FS.readBinFile src IO.FS.writeBinFile dst contents
Instances For
Copy a directory and all its contents from src to dst.
Returns the normalized real path of a file if it exists. Otherwise, returns "".
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the normalized real path of a file if and only if it exists.