|
Packit |
9ff65e |
(******************************************************************************)
|
|
Packit |
9ff65e |
(* ocaml-fileutils: files and filenames common operations *)
|
|
Packit |
9ff65e |
(* *)
|
|
Packit |
9ff65e |
(* Copyright (C) 2003-2014, Sylvain Le Gall *)
|
|
Packit |
9ff65e |
(* *)
|
|
Packit |
9ff65e |
(* This library is free software; you can redistribute it and/or modify it *)
|
|
Packit |
9ff65e |
(* under the terms of the GNU Lesser General Public License as published by *)
|
|
Packit |
9ff65e |
(* the Free Software Foundation; either version 2.1 of the License, or (at *)
|
|
Packit |
9ff65e |
(* your option) any later version, with the OCaml static compilation *)
|
|
Packit |
9ff65e |
(* exception. *)
|
|
Packit |
9ff65e |
(* *)
|
|
Packit |
9ff65e |
(* This library is distributed in the hope that it will be useful, but *)
|
|
Packit |
9ff65e |
(* WITHOUT ANY WARRANTY; without even the implied warranty of *)
|
|
Packit |
9ff65e |
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file *)
|
|
Packit |
9ff65e |
(* COPYING for more details. *)
|
|
Packit |
9ff65e |
(* *)
|
|
Packit |
9ff65e |
(* You should have received a copy of the GNU Lesser General Public License *)
|
|
Packit |
9ff65e |
(* along with this library; if not, write to the Free Software Foundation, *)
|
|
Packit |
9ff65e |
(* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *)
|
|
Packit |
9ff65e |
(******************************************************************************)
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
type current_dir_type =
|
|
Packit |
9ff65e |
Short
|
|
Packit |
9ff65e |
| Long
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
type filename_part =
|
|
Packit |
9ff65e |
Root of string
|
|
Packit |
9ff65e |
| ParentDir
|
|
Packit |
9ff65e |
| CurrentDir of current_dir_type
|
|
Packit |
9ff65e |
| Component of string
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
type filename = string
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
type extension = string
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
(* Utility function to parse filename *)
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
let begin_string str lst = (str, lst)
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
let add_string str1 (str2, lst) = (str1 ^ str2, lst)
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
let end_string (str, lst) = (Component str) :: lst
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
|
|
Packit |
9ff65e |
(* Definition of the caracteristic length of a path *)
|
|
Packit |
9ff65e |
let path_length = 80
|