in reply to find2perl and 256 chars folder length

See also http://www.foken.de/alexander/projekte/windows/deepcopy.html#Algorithm for how to cope with Windows' rather short path limits, using some tricks meant for ancient "8.3" software.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: find2perl and 256 chars folder length

Replies are listed 'Best First'.
Re^2: find2perl and 256 chars folder length
by Koba (Initiate) on Mar 20, 2010 at 12:35 UTC
    But this is exactly what my problem is. I need a way to tell the perl interpreter to use only short names. Or i have to rewrite the find module to convert each file/folder into short named version before searching the next subfolder. Anyone any idea?

      One option would be to use windows tools instead to get your list of files. Eg.

      c:\test>dir /s /b Zz* c:\test\ZZXYZ c:\test\abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij +klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza +bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr +stuvwxyzabcdefghijklmnopqrstuvwxyz\ZZZXYX

      You can either pipe the list into your script, or invoke the command via a piped open and get it that way.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      Download the source from my page, find the functions I used, and use Win32::API or one of the existing Win32 functions to port my algorithm to perl. Win32::GetShortPathName() and Win32::GetLongPathName() are documented in the latter module, but they are availabe as CORE functions (without use Win32;), so you don't even have to mess with Win32::API.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)