Module type FileUtil.FILE_UTILS


module type FILE_UTILS = sig .. end
Operation available. Filename are considered to be valid filename for the current running OS


Module to manipulate real file
val ls : FileUtil.filename -> FileUtil.filename list
List the content of a directory
val filter : FileUtil.test_file -> FileUtil.filename list -> FileUtil.filename list
Apply a filtering pattern to a filename
val test : FileUtil.test_file -> FileUtil.filename -> bool
Test the existence of the file...
val which : ?path:FileUtil.filename list -> FileUtil.filename -> FileUtil.filename
Try to find the executable in the PATH. Use environement variable PATH if none is provided
val mkdir : ?parent:bool -> ?mode:int -> FileUtil.filename -> unit
Create the directory which name is provided. Turn parent to true if you also want to create every topdir of the path. Use mode to provide some specific right ( default 755 ).
val touch : ?create:bool -> FileUtil.filename -> unit
Modify the time stamp of the given filename. Turn create to false if you don't want to create the file
val find : ?follow:FileUtil.action_link ->
FileUtil.test_file ->
FileUtil.filename -> ('a -> FileUtil.filename -> 'a) -> 'a -> 'a
find ~follow:fol tst fln exec accu : Descend the directory tree starting from the given filename and using the test provided to find what is looking for. You cannot match current_dir and parent_dir. For every file found, the action exec is done, using the accu to start. For a simple file listing, you can use find True "." ( fun x y -> x :: y ) []
val rm : ?force:FileUtil.interactive ->
?recurse:bool -> FileUtil.filename list -> unit
Remove the filename provided. Turn recurse to true in order to completely delete a directory
val cp : ?follow:FileUtil.action_link ->
?force:FileUtil.interactive ->
?recurse:bool -> FileUtil.filename list -> FileUtil.filename -> unit
Copy the hierarchy of files/directory to another destination
val mv : ?force:FileUtil.interactive -> FileUtil.filename -> FileUtil.filename -> unit
Move files/directory to another destination
val readlink : FileUtil.filename -> FileUtil.filename
Return the real filename of a filename which could have link
val pwd : unit -> FileUtil.filename
Return the currend dir
val cmp : ?skip1:int ->
FileUtil.filename -> ?skip2:int -> FileUtil.filename -> int option
cmp skip1 fln1 skip2 fln2 : Compare files fln1 fln2 starting at pos skip1 * skip2 and returning the first octect where a difference occurs. Returns * (Some -1) if one of the file is not readable or if it is not a file.
val du : FileUtil.filename list ->
FileUtil.size * (FileUtil.filename * FileUtil.size) list
du fln_lst : Returns the amount of space of all the file * which are subdir of fln_lst. Also returns details for each * file scanned
val stat : FileUtil.filename -> FileUtil.stat
stat fln : Returns information about the file ( like Unix.stat )

For future release :