cannot get the exist or glob or size function work with UNC path folders So to work with long folders i used the UNC way to create smaller paths on windows machine. exampel showsn below doesnot have long path. But testing it out to see why these functions don't work
my $directory = "C:\\test\\test2"; $directory =~ s/\//\\/g; if ($directory !~ /^\\\\?\\/ ) {$directoryUNC ="\\\\?\\".$direct +ory }; $len = length($directoryUNC ); $directoryshort = Win32::GetShortPathName($directoryUNC ); print "short name for $directory is $directoryshort \n"; chdir "$directoryshort" or die "Failed to go to $directoryshort: $ +!"; $FolderName = getcwd(); opendir DIR, $FolderName or die "Cannot open directory: $!"; while ( defined( my $file = readdir(DIR) ) ) { $fileSize= -s $file; print "file size for $file is $fileSize\n"; }
this does not print the file size. Have tried other things like exists function doesn't work either. Would someone know how to use these functions with the short UNC path
In reply to size and exist doesnot work with UNC folders/dir by mukes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |