OCaml Forge
SCM

Detail: [#668] FileUtil.mkdir and relative path on win32

Bugs: Browse | Download .csv | Monitor

[#668] FileUtil.mkdir and relative path on win32

Date:
2010-06-18 08:39
Priority:
3
State:
Open
Submitted by:
ygrek (ygrek)
Assigned to:
Sylvain Le Gall (gildor-admin)
Resolution:
None
Severity:
major
Version:
v0.4.0
Operating System:
Windows XP
Summary:
FileUtil.mkdir and relative path on win32

Detailed description
Objective Caml version 3.11.0

# #use "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:

- : unit = ()
# #require "fileutils";;
C:\my\ocaml\lib: added to search path
C:/my/ocaml/lib\unix.cma: loaded
c:\my\ocaml-3.11.0\lib\site-lib\fileutils: added to search path
c:\my\ocaml-3.11.0\lib\site-lib\fileutils\fileutils.cma: loaded
# FileUtil.all_upper_dir "a\\b";;
Exception: FilePath.EmptyFilename.
# ^Z

Hence mkdir "a\\b" will also raise this exception.

Followup

Message
Date: 2010-06-18 09:08
Sender: Sylvain Le Gall

all_upper_dir should not be used -- though I don't enforce it through a .mli file. Something that should be done ;-)

Here are the step to reproduce your bug:
# #require "fileutil";;
No such package: fileutil
# #require "fileutils";;
/usr/lib/ocaml/unix.cma: loaded
/usr/lib/ocaml/fileutils: added to search path
/usr/lib/ocaml/fileutils/fileutils.cma: loaded
# FilePath.Win32Path.dirname "a\\b";;
- : FilePath.Win32Path.filename = "a"
# FilePath.Win32Path.dirname "a";;
- : FilePath.Win32Path.filename = ""
# FilePath.Win32Path.dirname "";;
Exception: FilePath.EmptyFilename.

Thanks for the bug report.

Attached Files:

Changes:

Field Old Value Date By
assigned_tonone2010-06-18 09:08gildor-admin