Frama-C:
Plug-ins:
Libraries:

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.

  • since Frama-C+dev
  • before Frama-C+dev

    was in Extlib and used a string instead of Filepath.t

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).

  • raises Temp_file_error

    if the temp file cannot be created.

  • before Frama-C+dev

    was in Extlib and returned a string instead of Filepath.t, raised Temp_file_error, keep was named debug and prefix and suffix arguments were not named.

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).

  • before 28.0-Nickel

    returned a string instead of Filepath.t

  • before Frama-C+dev

    was in Extlib, raised Temp_file_error and keep was named debug and prefix and suffix arguments were not named.