Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename under Windows #2524

Closed
vicuna opened this issue Jul 11, 2000 · 2 comments
Closed

Filename under Windows #2524

vicuna opened this issue Jul 11, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 11, 2000

Original bug ID: 159
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

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

@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

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

@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

Fixed 2000-07-25 by Xavier

@vicuna vicuna closed this as completed Jul 25, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant