ocaml-fileutils icon indicating copy to clipboard operation
ocaml-fileutils copied to clipboard

FileUtil.mkdir and relative path on win32

Open gildor478 opened this issue 4 years ago • 0 comments

This bug has been migrated from artifact #668 on forge.ocamlcore.org. It was assigned to user102.

user116 posted on 2010-06-18 08:39:43:

    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.

user102 replied on 2010-06-18 09:08:48:

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.

gildor478 avatar Oct 24 '20 15:10 gildor478