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

[DOC PATCH] & More File::Path issues

Thread Next
Jos I . Boumans
April 30, 2003 04:08
[DOC PATCH] & More File::Path issues
Message ID:

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 
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.



--- lib/File/        Wed Apr 30 10:39:50 2003
+++ lib/File/    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,
+Therefore, you must be extremely careful about using C<rmtree($foo,$bar,
 in situations where security is an issue.
+=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 
 =head1 AUTHORS

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About