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