Recent

Author Topic: How to use FindAllFiles successfully on very long (> 260 chars) directories?  (Read 3322 times)

Gizmo

  • Hero Member
  • *****
  • Posts: 831
Further to this thread (http://forum.lazarus.freepascal.org/index.php/topic,26488.0.html) I have a different but related question about files that are in very long folder names that exceed 260 characters.

As well as copying these files from an already long but valid directory of, say 200 characters (now successfully - see thread linked above) to a new location that becomes longer than 260 characters (due to recreating the original path in the new loaction) I also have to SEARCH for them, in the first place.

What I have noticed is that FindAllFiles seems to return only those files in directories of say 250 characters or less. Unless I am using it incorrectly?

Is there a way to make FindAllFiles search the entire path which could feasibly be up to 32K in length (as supported by NTFS but not Windows unless use of \\?\ is prefixed)?

engkin

  • Hero Member
  • *****
  • Posts: 3112
It seems to me that the Unicode version of Windows FindFirstFile is being used on the trunk. If the version you have is using FindFirstFileW as well, then prefix it with "\\?\" and you should be ok.
« Last Edit: November 19, 2014, 11:24:17 pm by engkin »

Gizmo

  • Hero Member
  • *****
  • Posts: 831
Thanks Engkin, but that's the trouble - I am not using the Unicode aware FPC 2.7.X. I use the stable Lazarus 1.2.6 and FPC 2.6.4 for my applications.

I wondered if it is possible to have Lazarus 1.2.6 installed and then configured to use either the stable FPC 2.6.4 OR the snapshot trunk of 2.7.X, at least to test this theory. According to http://wiki.freepascal.org/Multiple_Lazarus#Who_needs_multiple_Lazarus_instances_and_who_does_not.3F this is possible :

You need multiple Lazarus instances...

    to have several versions of Lazarus
    to have one Lazarus version compiled with several different versions of FPC


However, reading through the article I couldn't see how you configure your 1.2.6 Lazarus Windows IDE to use FPC 2.7.X OR 2.6.4? I looked here (ftp://ftp.freepascal.org/pub/lazarus/snapshots/) for a 1.2.6 and FPC2.7.X installable bundle, but could only find a Lazarus 1.1 and FPC 2.7.X installation that dates back to mid 2013 (ftp://ftp.freepascal.org/pub/lazarus/snapshots/Lazarus-1.1-42538-fpc-2.7.1-20130901-win32.exe).
« Last Edit: November 20, 2014, 12:08:34 am by Gizmo »

engkin

  • Hero Member
  • *****
  • Posts: 3112
I wondered if it is possible to have Lazarus 1.2.6 installed and then configured to use either the stable FPC 2.6.4 OR the snapshot trunk of 2.7.X, at least to test this theory.
The shortest path is to use FPCUp.

 

TinyPortal © 2005-2018