in reply to Re: find2perl and 256 chars folder length
in thread find2perl and 256 chars folder length

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?
  • Comment on Re^2: find2perl and 256 chars folder length

Replies are listed 'Best First'.
Re^3: find2perl and 256 chars folder length
by BrowserUk (Patriarch) on Mar 20, 2010 at 13:12 UTC

    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.
Re^3: find2perl and 256 chars folder length
by afoken (Chancellor) on Mar 20, 2010 at 17:45 UTC

    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". ;-)