Skip to main content

Module fs

Module fs 

Source
Expand description

Files, directories and the environment of the process: IO.FS, IO.getEnv, IO.appPath, the current directory, process and thread ids, random bytes and timeit.

Functions§

lean_chmod⚠
IO.setAccessRights through chmod : (@& FilePath) → UInt32 → IO Unit.
lean_io_allocprof⚠
allocprof : (@& String) → IO α → IO α: runs the action (this runtime keeps no allocation profile, so it prints an empty line).
lean_io_app_path⚠
IO.appPath : IO FilePath: the executable, with symbolic links resolved.
lean_io_create_dir⚠
IO.FS.createDir : @& FilePath → IO Unit.
lean_io_create_tempdir⚠
IO.FS.createTempDir : IO FilePath.
lean_io_create_tempfile⚠
IO.FS.createTempFile : IO (Handle × FilePath).
lean_io_current_dir⚠
IO.currentDir : IO FilePath.
lean_io_force_exit⚠
IO.Process.forceExit : UInt8 → IO α: exits without flushing the standard streams.
lean_io_get_num_heartbeats⚠
IO.getNumHeartbeats : BaseIO Nat: the value last set by setNumHeartbeats (this runtime counts no heartbeats).
lean_io_get_random_bytes⚠
IO.getRandomBytes : USize → IO ByteArray, from /dev/urandom.
lean_io_get_tid⚠
IO.getTID : BaseIO UInt64: the id of the OS thread.
lean_io_getenv⚠
IO.getEnv : @& String → BaseIO (Option String).
lean_io_hard_link⚠
IO.FS.hardLink : (orig link : @& FilePath) → IO Unit.
lean_io_metadata⚠
System.FilePath.metadata : @& FilePath → IO Metadata.
lean_io_process_get_current_dir⚠
IO.Process.getCurrentDir : IO FilePath.
lean_io_process_get_pid⚠
IO.Process.getPID : BaseIO UInt32.
lean_io_process_set_current_dir⚠
IO.Process.setCurrentDir : @& FilePath → IO Unit.
lean_io_read_dir⚠
IO.FS.readDir : @& FilePath → IO (Array DirEntry): DirEntry is ⟨root, fileName⟩.
lean_io_realpath⚠
IO.FS.realPath : FilePath → IO FilePath (consumes fname).
lean_io_remove_dir⚠
IO.FS.removeDir : @& FilePath → IO Unit.
lean_io_remove_file⚠
IO.FS.removeFile : @& FilePath → IO Unit.
lean_io_rename⚠
IO.FS.rename : (old new : @& FilePath) → IO Unit; the file name of an error is "<old> and/or <new>".
lean_io_set_heartbeats⚠
IO.setNumHeartbeats : Nat → BaseIO Unit (consumes count).
lean_io_symlink_metadata⚠
System.FilePath.symlinkMetadata : @& FilePath → IO Metadata.
lean_io_timeit⚠
timeit : (@& String) → IO α → IO α: runs the action and prints <msg> <time> on the standard error stream.