ashkulz / NppFTP

Plugin for Notepad++ allowing FTP, FTPS, FTPES and SFTP communications
https://ashkulz.github.io/NppFTP/
321 stars 93 forks source link

File with the long path can't be opened #338

Open cadappl opened 2 years ago

cadappl commented 2 years ago

Description of the Issue

NppFTP uses the cache paths to store the remote files. If the remote file, for example, the Java class file, is put in deep directories and has a long filename, the length of the filename is beyond MAX_PATH (260 characters). The situation becauses common if NppFTP is used to work with Android source code with Ubuntu.

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation introduced the solution. It's apprecicated that NppFTP can have the improvement.

Steps to Reproduce the Issue

  1. Create the file /tmp/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/abcdefghijklmnopqrstuvwxyz01234567890/0
  2. Try to open the file with NppFTP

Expected Behavior

File won't be downloaded from the reomote.

Actual Behavior

File can be downloaded from the reomote.

gobbedy commented 1 year ago

I have the same issue. To add to what @cadappl said, it seems that the solution is simply to add this to notepad++'s application manifest:

    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>

ie to this file: https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/notepad%2B%2B.exe.manifest

This is based on the link shared by @cadappl (https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation )

stoppeye commented 9 months ago

@gobbedy: thanks for this hint! But I guess this is only useful, if you do your own build, correct?