Frama-C API - Temp_files
This module provides a layer above the Filesystem
module to handle automatic removal of temporary files when the program exits, except if exit is caused by a signal and except if keep
is given and set to true. If keep
is omitted, the files are only kept if the debug key Kernel.dkey_pp_keep_temp_files
is set. If the file is kept, a message with the path of the preserved file or directory is emitted. When the temporary file or directory cannot be created, these functions abort.
val cleanup_at_exit : Filepath.t -> unit
cleanup_at_exit file
indicates that file
must be removed when the program exits (except if exit is caused by a signal). If file
does not exist, nothing happens.
val file : ?keep:bool -> prefix:string -> suffix:string -> unit -> Filepath.t
Similar to Filename.temp_file
except that the temporary file will be deleted at the end of the execution (see above).
val dir : ?keep:bool -> prefix:string -> suffix:string -> unit -> Filepath.t
Similar to Filename.temp_dir
except that the temporary directory will be deleted at the end of the execution (see above).