SCM Repository
Diff of /sml/trunk/src/cm/paths/fileid.sml
Parent Directory
|
Revision Log
|
Patch
revision 936, Thu Sep 20 19:47:11 2001 UTC | revision 937, Thu Sep 20 21:20:28 2001 UTC | |
---|---|---|
# | Line 15 | Line 15 |
15 | val compare : id * id -> order | val compare : id * id -> order |
16 | ||
17 | val fileId : string -> id | val fileId : string -> id |
18 | ||
19 | val canonical : string -> string | |
20 | end | end |
21 | ||
22 | structure FileId :> FILEID = struct | structure FileId :> FILEID = struct |
# | Line 52 | Line 54 |
54 | in | in |
55 | PRESENT (F.fileId f) handle _ => ABSENT (expandPath f) | PRESENT (F.fileId f) handle _ => ABSENT (expandPath f) |
56 | end | end |
57 | ||
58 | fun canonical "" = "" | |
59 | | canonical f = | |
60 | if (F.access (f, []) handle _ => false) then | |
61 | let val f' = P.mkCanonical f | |
62 | in | |
63 | if F.compare (F.fileId f, F.fileId f') = EQUAL then f' | |
64 | else f | |
65 | end | |
66 | else | |
67 | let val { dir, file } = P.splitDirFile f | |
68 | in | |
69 | P.joinDirFile { dir = canonical dir, file = file } | |
70 | end | |
71 | end | end |
|
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |