Skip to content

lpil/process_file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

process_file

Automatically clean-up temporary files when processes exit.

Package Version Hex Docs

On the BEAM the best way to do clean-up is to have it be performed when the process exits, so it is done even if the process exited unexpectedly. This package lets processes register file system paths as belonging to them, so they get deleted on exit.

gleam add process_file@1
// Start the process file manager.
// Ideally you would add it to your supervision tree.
let assert Ok(Started(data: manager, ..)) = process_file.start()

// Elsewhere in your code, register file ownership with the manager.
// It'll be deleted when the process that called the function exits.
process_file.register(manager, "/tmp/my-tmp-file1.txt")

Further documentation can be found at https://hexdocs.pm/process_file.

About

Automatically clean-up temporary files when processes exit

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages