Skip Menu |

This queue is for tickets about the File-Util CPAN distribution.

Report information
The Basics
Id: 46368
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: File-Util

People
Owner: Nobody in particular
Requestors: friedrich.neubarth [...] ofai.at
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: File::Util does not support absolute filenames in Windows
Date: Tue, 26 May 2009 15:44:55 +0200
To: bug-File-Util [...] rt.cpan.org
From: Friedrich Neubarth <friedrich.neubarth [...] ofai.at>
a quick test: use File::Util; my($f) = File::Util->new(); my $fn = 'c:\testpath\testfile'; $f -> touch($fn); -> gives a long error message (appended below). -> the error pertains in various functions, i.e. touch() ... the reason seems to be: - ':' is contained in $DIRSPLIT (and $ILLEGAL_CHR) ( -> a mere check for illegal characters immediately returns true) -> prospectous paths are split and joined by constant SL (chr(92) under Win) - on various places in the code -> the ':' gets lost, the ':\' sequence is transformed into illegal '\\' -> the drive letter is treated as a string belonging to a relative path name, so '.\' is prefixed to the pathname. - drive letter + colon strings under Windows seem to demand a special treatment. I don't see a quick fix. Best, Friedrich Neubarth ---------------------------------------------------------------------------------- PROCESS TERMINATED DUE TO ERRORS File::Util can't use this string for ╗the name of a directory½. ╗.\c\\testpath½ It contains illegal characters. Illegal characters are: \ (backslash) / (forward slash) : (colon) | (pipe) * (asterisk) ? (question mark) " (double quote) < (less than) Show quoted text
> (greater than)
\t (tab) \ck (vertical tabulator) \r (newline CR) \n (newline LF) Origin: This is a human error. Solution: A human must remove the illegal characters from this string. ARG _pak = File::Util ARG purpose = the name of a directory ARG string = .\c\\testpath 1. File::Util::_throw -called at line (1322) of blib\lib\File\Util.pm (autosplit into blib\lib\auto\File\Util\make_dir.al) -was called with args -was not called to evaluate anything 2. File::Util::make_dir -called at line (1087) of blib\lib\File\Util.pm (autosplit into blib\lib\auto\File\Util\touch.al) -was called with args -was not called to evaluate anything 3. File::Util::touch -called at line (4) of ...>testfileutil.pl -was called with args -was not called to evaluate anything
A new release is in progress that fixes this as well as UNC and network path support. -- Tommy Butler On Tue May 26 09:46:53 2009, fri77 wrote: Show quoted text
> a quick test: > > use File::Util; > my($f) = File::Util->new(); > my $fn = 'c:\testpath\testfile'; > $f -> touch($fn); > > -> gives a long error message (appended below). > -> the error pertains in various functions, i.e. touch() ... > > the reason seems to be: > - ':' is contained in $DIRSPLIT (and $ILLEGAL_CHR) > ( -> a mere check for illegal characters immediately returns true) > -> prospectous paths are split and joined by constant SL (chr(92) > under > Win) - on various places in the code > -> the ':' gets lost, the ':\' sequence is transformed into illegal > '\\' > -> the drive letter is treated as a string belonging to a relative > path > name, so '.\' is prefixed to the pathname. > > - drive letter + colon strings under Windows seem to demand a special > treatment. I don't see a quick fix. > > Best, Friedrich Neubarth > > > ----------------------------------------------------------------------
------------ Show quoted text
> > PROCESS TERMINATED DUE TO ERRORS > > File::Util can't use this string for ╗the name of a directory½. > ╗.\c\\testpath½ > It contains illegal characters. > > Illegal characters are: > \ (backslash) > / (forward slash) > : (colon) > | (pipe) > * (asterisk) > ? (question mark) > " (double quote) > < (less than)
> > (greater than)
> \t (tab) > \ck (vertical tabulator) > \r (newline CR) > \n (newline LF) > > Origin: This is a human error. > Solution: A human must remove the illegal characters from this string. > > ARG _pak = File::Util > ARG purpose = the name of a directory > ARG string = .\c\\testpath > > > 1. File::Util::_throw > -called at line (1322) of blib\lib\File\Util.pm (autosplit into > blib\lib\auto\File\Util\make_dir.al) > -was called with args > -was not called to evaluate anything > > > 2. File::Util::make_dir > -called at line (1087) of blib\lib\File\Util.pm (autosplit into > blib\lib\auto\File\Util\touch.al) > -was called with args > -was not called to evaluate anything > > > 3. File::Util::touch > -called at line (4) of ...>testfileutil.pl > -was called with args > -was not called to evaluate anything >
Fix is in latest development release (3.30_001). It is in testing. When it passes CPAN Tester's smoke tests, I'll release it as stable. UNC paths are not supported. I'm considering whether or not they should be supported. I would suggest using mapped drives instead.
Fixed. Just uploaded newest version 3.31 to CPAN, which should be available for download in the next few hours. Thank you for reporting this bug. On Tue May 26 09:46:53 2009, fri77 wrote: Show quoted text
> a quick test: > > use File::Util; > my($f) = File::Util->new(); > my $fn = 'c:\testpath\testfile'; > $f -> touch($fn);