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.root_dir_name? #2505
Comments
Comment author: administrator
Hi Markus, My first Unix-based reflex would be to say that the root directory is the The problem I see with "root_dir_name": I don't think there is such a If you can tell me what it should do under Windows, I'll file this as a -- Damien |
Comment author: administrator Hi Damien, On Thu, 29 Apr 2004, Damien Doligez wrote:
Unfortunately not: dirname current_dir_name = current_dir_name So it's not only the root directory "/" that has this property.
Oh well, I can only hope that Microsoft drops this outdated concept of Anyway, I had thought that e.g. "C:" denotes that root directory of Regards, -- |
Comment author: @damiendoligez We still don't know what "the" root might be under windows. Moreover, when you decompose with Filename.dirname, the base case is when the result is equal to the argument. Then if Filename.is_relative is true, you are in the "." case; if it's false you are in the root case. I don't think we can do better than that. |
Original bug ID: 2505
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-31T10:46:16Z)
Resolution: suspended
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
it seems that the function "root_dir_name" is missing in module
"Filename". The problem is that if I want to decompose a path using
successive applications of "dirname", I want to compare the current
directory to either "." or "/" on Unix-systems to detect the base
case. Unfortunately, we only have "current_dir_name" for ".", but not
"root_dir_name" for "/" (or whatever it is on other systems), which may
make it difficult to write portable code.
Regards
Markus
--
Markus Mottl http://www.oefai.at/~markus markus@oefai.at
The text was updated successfully, but these errors were encountered: