[Haskell-cafe] RE: ANN: System.FilePath 0.9

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Jul 28 06:38:11 EDT 2006

Hello Andrew,

Thursday, July 27, 2006, 10:07:11 PM, you wrote:

>> I admit I don't know enough to say how the lpt1 issue should be
>> handled.  Is there any Win32 call I can make that will help me avoid
>> accidentally opening these magic files?  Say, if I call open with
>> O_CREAT | O_EXCL?  Unfortunately, I can find very little information on
>> how one should handle this issue.

> Thanks to a suggestion from Bulat to use c_open, I was able to test
> O_WRONLY | O_CREAT | O_EXCL on Windows.  In fact, Windows does allow
> files like "nul" to be opened (as many times as you like) with these
> flags, which I find dismaying.  So I still don't know the proper way to
> handle them.

you can open and then check for existence used getDirectoryContents
call. of course, i don't mean that it is the best nor official way :)

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list