Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000161OCamlOCaml generalpublic2000-07-12 10:592000-07-25 18:29
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000161: Unix.opendir under Windows
DescriptionI'm getting the following behavior for Unix.opendir under Windows 98,
ocaml-3.00:

        # Unix.opendir "c:\\";;
        Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
        # Unix.opendir "/";;
        Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
        # Unix.opendir "\\";;
        Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
        # Unix.opendir "c:/windows";;
        - : Unix.dir_handle = <abstr>
        # Unix.opendir "/windows ";;
        - : Unix.dir_handle = <abstr>

Under Windows 2000:

        # Unix.opendir "c:\\";;
        - : Unix.dir_handle = <abstr>
        # Unix.opendir "/";;
        Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
        # Unix.opendir "/winnt";;
        - : Unix.dir_handle = <abstr>


-Trevor

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0002139)
administrator (administrator)
2000-07-25 13:46

> > I'm getting the following behavior for Unix.opendir under Windows 98,
> > ocaml-3.00:
> >
> > # Unix.opendir "c:\\";;
> > Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
>
> Well, Unix.opendir is implemented by FindFirstFile, and as I said in
> my previous message, that function is documented not to work on root
> directories. (The recommended workaround is to do
> Unix.opendir "c:\\*", but this is really ugly.)

OK. I have been using

  Unix.opendir "c:\\ "

as my ugly hack. Is there some reason to believe that your ugly hack
("C:\\*") is going to be more robust than my ugly hack ("C:\\ ")? If
so, I'll change mine.

I still consider this a bug in Unix.opendir, because the
implementation does not match the documentation (the Ocaml
documentation, not the VC++ documentation). I hope you will fix it,
either by implementing the ugly hack so I don't have to, or by
changing the documentation so that the implementation matches the
spec.


Thanks,
Trevor

(0002140)
administrator (administrator)
2000-07-25 18:28

> I'm getting the following behavior for Unix.opendir under Windows 98,
> ocaml-3.00:
>
> # Unix.opendir "c:\\";;
> Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
> # Unix.opendir "/";;
> Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
> # Unix.opendir "\\";;
> Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
> # Unix.opendir "c:/windows";;
> - : Unix.dir_handle = <abstr>
> # Unix.opendir "/windows ";;
> - : Unix.dir_handle = <abstr>
>
> Under Windows 2000:
>
> # Unix.opendir "c:\\";;
> - : Unix.dir_handle = <abstr>
> # Unix.opendir "/";;
> Uncaught exception: Unix.Unix_error (Unix.EINVAL, "opendir", "").
> # Unix.opendir "/winnt";;
> - : Unix.dir_handle = <abstr>

Well, Unix.opendir is implemented by FindFirstFile, and as I said in
my previous message, that function is documented not to work on root
directories. (The recommended workaround is to do
Unix.opendir "c:\\*", but this is really ugly.)

- Xavier

(0002141)
administrator (administrator)
2000-07-25 18:29

Windows lossage.
(0002142)
administrator (administrator)
2000-07-28 10:41

> The best fix I see is to dump VC++ entirely and go with Cygwin, whose
> Unix emulation library is much better than anything we could write.
> It seems Cygwin made progress recently on the thread-safety issue, so
> the last obstacle to using Cygwin might be disappearing.

That would be wonderful -- I hate to install VC++, it is a fat hog.
And, I need to install Cygwin anyway, I use it for make, bash, and
some other things. So, it gets my vote. I would be happy to be a
beta tester if you decide to make the change.


-Trevor

(0002143)
administrator (administrator)
2000-07-28 11:37

> OK. I have been using
> Unix.opendir "c:\\ "
> as my ugly hack. Is there some reason to believe that your ugly hack
> ("C:\\*") is going to be more robust than my ugly hack ("C:\\ ")? If
> so, I'll change mine.

I don't know, except that "my" hack is the one suggested by the MSDN
documentation.

> I still consider this a bug in Unix.opendir, because the
> implementation does not match the documentation (the Ocaml
> documentation, not the VC++ documentation). I hope you will fix it,
> either by implementing the ugly hack so I don't have to, or by
> changing the documentation so that the implementation matches the
> spec.

The best fix I see is to dump VC++ entirely and go with Cygwin, whose
Unix emulation library is much better than anything we could write.
It seems Cygwin made progress recently on the thread-safety issue, so
the last obstacle to using Cygwin might be disappearing.

- Xavier Leroy


- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker