Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /smlnj-lib/trunk/Util/path-util-sig.sml
ViewVC logotype

Annotation of /smlnj-lib/trunk/Util/path-util-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3710 - (view) (download)

1 : monnier 7 (* path-util-sig.sml
2 :     *
3 : jhr 3710 * COPYRIGHT (c) 2012 The Fellowship of SML/NJ (http://www.smlnj.org)
4 :     * All rights reserved.
5 : monnier 7 *
6 :     * Various higher-level pathname and searching utilities.
7 :     *)
8 :    
9 :     signature PATH_UTIL =
10 :     sig
11 :    
12 : jhr 3577 (* findFile paths name
13 :     * returns SOME(p/name), where p is the first path in paths such that p/name exists.
14 : jhr 3710 * If no such file exists, then NONE is returned. If name is an absolute path, then
15 :     * SOME name is returned if it exists.
16 : jhr 3577 *)
17 :     val findFile : string list -> string -> string option
18 :    
19 :     (* findFiles (paths, mode) name
20 : jhr 3710 * returns a list of p/name values, where p is in paths and p/name exists. If name is an
21 :     * absolute path, then [name] is returned if it exists.
22 : jhr 3577 *)
23 : monnier 7 val findFiles : string list -> string -> string list
24 :    
25 : jhr 3577 (* existsFile pred paths name
26 :     * returns SOME(p/name), where p is the first path in paths such that p/name satisfies
27 : jhr 3710 * the given predicate. If no such file exists, then NONE is returned. If name is an
28 :     * absolute path, then SOME name is returned if it satisfies the predicate.
29 : jhr 3577 *)
30 : monnier 7 val existsFile : (string -> bool) -> string list -> string -> string option
31 :    
32 : jhr 3577 (* allFiles pred paths name
33 :     * returns a list of all p/name values, such that p is in paths and p/name satisfies
34 : jhr 3710 * the given predicate. The order of the path list is preserved in the result. If name
35 :     * is an absolute path, then [name] is returned if it satisfies the predicate.
36 : jhr 3577 *)
37 :     val allFiles : (string -> bool) -> string list -> string -> string list
38 : monnier 7
39 : jhr 3577 (* findExe paths name
40 :     * returns SOME(p/name), where p is the first path in paths such that p/name exists and
41 : jhr 3710 * is executable. If no such file exists, then NONE is returned. If name is an
42 :     * absolute path, then SOME name is returned if it is executable.
43 : jhr 3577 *)
44 :     val findExe : string list -> string -> string option
45 :    
46 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0