MantisBT - OCaml
View Issue Details
0000159OCaml~DO NOT USE (was: OCaml general)public2000-07-11 17:402000-07-25 18:29
administrator 
 
normalminoralways
closedfixed 
 
 
0000159: Filename under Windows
I am using ocaml-3.00 under Windows. According to the documentation
for the Filename module, dirname and basename should satisfy the
following property:

      concat (dirname name) (basename name)
      returns a file name which is equivalent to name.

But:

       dirname "c:/windows" = "c:",
       basename "c:/" = "windows"
       and "c:windows" is a relative pathname to the file windows in
         the current directory (provided it is on the c: drive)

Similarly:

       dirname "c:/" = "c:",
       basename "c:/" = ""
       and "c:" is the current directory, not "c:/"

(It doesn't matter whether / or \ is used, the results are the same.)


-Trevor

No tags attached.
Issue History
2005-11-18 10:13administratorNew Issue
2017-02-23 16:36doligezCategoryOCaml general => -OCaml general
2017-03-03 17:55doligezCategory-OCaml general => -(deprecated) general
2017-03-03 18:01doligezCategory-(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04doligezCategory~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Notes
(0000419)
administrator   
2000-07-25 18:15   
Hi Trevor,

> I am using ocaml-3.00 under Windows. According to the documentation
> for the Filename module, dirname and basename should satisfy the
> following property:
> concat (dirname name) (basename name)
> returns a file name which is equivalent to name.
> But:
>
> dirname "c:/windows" = "c:",
> basename "c:/" = "windows"
> and "c:windows" is a relative pathname to the file windows in
> the current directory (provided it is on the c: drive)

Well spotted. I just fixed Filename.dirname so that it doesn't strip
the "/" or "\" immediately following a drive specification.

Cheers,

- Xavier

(0000420)
administrator   
2000-07-25 18:29   
Fixed 2000-07-25 by Xavier