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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.