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

Unix.stat under Windows #2527

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

Unix.stat under Windows #2527

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

Comments

@vicuna
Copy link

vicuna commented Jul 11, 2000

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

Bug description

Perhaps this is not a bug. However, it's something I tripped over.

Unix.stat is behaving with different conventions under Windows and
Unix.

For example, in Windows, Unix.stat on "c:\windows\" and
"c:/windows/" will always fail, while Unix.stat on "c:/windows" or
"c:\windows" will succeed.

In contrast, under Solaris Unix.stat will succeed on both "/usr"
and "/usr/".

More confusing: in Windows Unix.stat will succeed with "/windows" but
fail with "/windows/".

Finally, in Windows Unix.stat on "c:\" and "c:/" will succeed, and
Unix.stat on "c:" will fail. (In fact c: refers to the current
directory).

-Trevor

@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

Perhaps this is not a bug. However, it's something I tripped over.
Unix.stat is behaving with different conventions under Windows and
Unix.
For example, in Windows, Unix.stat on "c:\windows\" and
"c:/windows/" will always fail, while Unix.stat on "c:/windows" or
"c:\windows" will succeed.

In contrast, under Solaris Unix.stat will succeed on both "/usr"
and "/usr/".

More confusing: in Windows Unix.stat will succeed with "/windows" but
fail with "/windows/".

Finally, in Windows Unix.stat on "c:\" and "c:/" will succeed, and
Unix.stat on "c:" will fail. (In fact c: refers to the current
directory).

Right. Unix.stat is just a wrapper around the C library stat()
function, which (in Visual C++ 6.0) is implemented using
FindFirstFile(). The latter is documented as not accepting trailing
slashes, and not accepting a root directory such as C:. The stat()
wrapper in the C library special-cases root directories, but not
trailing slashes...

  • Xavier

@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

Windows lossage.

@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