develooper Front page | perl.perl5.porters | Postings from April 2003

[DOC PATCH] & More File::Path issues

Thread Next
From:
Jos I . Boumans
Date:
April 30, 2003 04:08
Subject:
[DOC PATCH] & More File::Path issues
Message ID:
20030430130758203+0200@nntp.perl.org
Greetings,

looking a bit more at my particular File::Path problem, it seems that 
various OS's have various path lengths that they allow, and perl (or 
probably the underlying system) 's error is not very descriptive of this.

So, at least on win32, this:
	'no such file or directory'
during a call to C<mkpath> (can) actually mean:
	'The path you're trying to create is probably too long'

below is a patch that at least informs the user of this (it also 
encorporates the typo fix sent earlier).

However, i can't help but think how nice it would be to actually have a 
way to shorten paths appropriately enough for the creation to still 
succeed.
on windows, i know there's some tricky magic going on that associates 
every long file name with a shorty~1 file, mostly for DOS compatibillity. 
maybe file::path can provide such a C<shorten> function, although i'm 
not quite sure what the rules for it should be on various OS's, or i'd 
have sent a patch for that instead.

Maybe some of the more experienced win32 users have opionins on this 
they'd like to share.

Regards,

--
	Jos


--- lib/File/Path.pm.org        Wed Apr 30 10:39:50 2003
+++ lib/File/Path.pm    Wed Apr 30 11:50:24 2003
@@ -90,8 +90,21 @@
 read and write access.  Note also that the occurrence of errors in
 rmtree can be determined I<only> by trapping diagnostic messages
 using C<$SIG{__WARN__}>; it is not apparent from the return value.
-Therefore, you must be extremely careful about using C<rmtree($foo,$bar,
0>
+Therefore, you must be extremely careful about using C<rmtree($foo,$bar,
0)>
 in situations where security is an issue.
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item *
+
+If C<mkpath> gives you the warning: B<No such file or directory>, this
+may mean that you've exceeded your filesystem's maximum path length.
+For example, on FAT filesystems (Win32), this is known to be 260 
+characters.
+
+=back
 
 =head1 AUTHORS


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About