package frama-c
Install
dune-project
Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
NNicolas Bellec
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
VVincent Botbol
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
SSylvain Chiron
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
BBenjamin Jorge
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
RRemi Lazarini
-
TTristan Le Gall
-
KKilyan Le Gallic
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
CCécile Ruet-Cros
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
sha256=a94384f00d53791cbb4b4d83ab41607bc71962d42461f02d71116c4ff6dca567
doc/frama-c.kernel/Frama_c_kernel/Filesystem/index.html
Module Frama_c_kernel.Filesystem
File system
val exists : Filepath.t -> boolEquivalent to Sys.file_exists.
val is_file : Filepath.t -> boolis_file f returns true iff f points to a regular file (or a symbolic link pointing to a file). Returns false if any errors happen when stat'ing the file.
val is_dir : Filepath.t -> boolEquivalent to Sys.is_directory.
val readdir : Filepath.t -> string arrayEquivalent to Sys.readdir.
val list_dir : Filepath.t -> string listContents of a directory.
val iter_dir : (string -> unit) -> Filepath.t -> unitIter through the contents of a directory.
val fold_dir : (string -> 'a -> 'a) -> Filepath.t -> 'a -> 'aFold over the contents of a directory.
val make_dir : ?parents:bool -> Filepath.t -> Unix.file_perm -> boolmake_dir ?parents name perm creates directory name with permission perm. If parents is true, recursively create parent directories if needed. parents defaults to false. Note that this function may create some of the parent directories and then fail to create the children, e.g. if perm does not allow user execution of the created directory. This will leave the filesystem in a modified state before raising an exception. Returns true if the directory was created, false otherwise.
val remove_file : Filepath.t -> unitTries to delete a file and never fails.
val remove_dir : Filepath.t -> unitTries to delete a directory and never fails.
val rename : Filepath.t -> Filepath.t -> unitEquivalent to Sys.rename.
Temporary files
See Temp_files module for automatic removal of temp files at exit.
val temp_file : prefix:string -> suffix:string -> Filepath.tSimilar to Filename.temp_file.
val temp_dir : prefix:string -> suffix:string -> Filepath.tSimilar to Filename.temp_dir.
File comparison
val digest : Filepath.t -> stringdigest p computes the hash of a file p using Stdlib.Digest.file.
val same_digest : Filepath.t -> Filepath.t -> boolsame_digest p1 p2 compares the hashes of two files p1 and p2 using Stdlib.Digest.file and returns true if they have the same.
High level Input/Output
val bincopy : bytes -> in_channel -> out_channel -> unitval copy_file : Filepath.t -> Filepath.t -> unitcopy_file source target copies source file to target file.
val iter_lines : Filepath.t -> (string -> unit) -> unitIter over all text lines in the file
Low level file Input/Output
This type defines what action with_open_in and with_open_out must perform when the file to open does not exist.
This type define what action with_open_out must perform when the file to open already exists.
type ('ch, 'a) safe_processor = ('ch -> 'a) -> ('a, string) resultA safe_processor helps to handle file operations while ensuring the file will be closed no matter what happens. It is a function that takes a file operation f as a parameter, opens a file and calls the f with the newly-created channel.
Same as safe_processor but when a Sys_error is raised, re-raise it after closing the file
val with_open_in :
?if_missing:action_if_missing ->
?binary:bool ->
?blocking:bool ->
Filepath.t ->
(in_channel, 'a) safe_processorwith_open_in path f opens file path for reading and calls f with the newly-created input channel. The file is closed when f returns or whenever an exception is thrown by f.
val with_open_in_exn :
?if_missing:action_if_missing ->
?binary:bool ->
?blocking:bool ->
Filepath.t ->
(in_channel, 'a) exn_processorSame as with_open_in but raises Sys_error instead of returning Error.
val with_open_out :
?if_missing:action_if_missing ->
?if_exists:action_if_exists ->
?binary:bool ->
?blocking:bool ->
Filepath.t ->
(out_channel, 'a) safe_processorwith_open_out path f calls f with a new output channel on the file path opened for writing. The file is closed when f returns or whenever an exception is thrown by f.
val with_open_out_exn :
?if_missing:action_if_missing ->
?if_exists:action_if_exists ->
?binary:bool ->
?blocking:bool ->
Filepath.t ->
(out_channel, 'a) exn_processorSame as with_open_out but raises Sys_error instead of returning Error.
val with_formatter : Filepath.t -> (Format.formatter, 'a) safe_processorwith_formatter path f calls f with a formatter writing to the file path. The file is closed and the formatter is flushed when f returns or whenever an exception is thrown by f.
val with_formatter_exn : Filepath.t -> (Format.formatter, 'a) exn_processorSame as with_formatter but raises Sys_error instead of returning Error.
module Compressed : sig ... endmodule Operators : sig ... endOpening this module allows to use shorter syntax to deal with files.