Community
    • Login

    Can’t open files with 103 char filenames, 259 char paths

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    21 Posts 5 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EkopalypseE
      Ekopalypse @Alan Kilborn
      last edited by

      @Alan-Kilborn

      https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Ekopalypse
        last edited by

        @Ekopalypse

        Well, that’s the standard answer – the company line, so to speak.
        Does it conform to reality?
        I mean, if the OP is to be believed (no reason to doubt him), he was able to open longer paths than the one “right on the border” that was giving him trouble.
        Of course, I tried his longer paths and couldn’t open those (Win10).

        Also curious about “really lengthening the limit” as described in your link.
        I wonder if it fully works for Notepad++.
        Meaning that the link lists API function names, does Notepad++ only use those? Likely not.
        Of course I’m sure that N++ source code is full of usage of MAX_PATH in declaring buffer sizes for paths, anyway…

        1 Reply Last reply Reply Quote 0
        • EkopalypseE
          Ekopalypse
          last edited by Ekopalypse

          @Alan-Kilborn said in Can’t open files with 103 char filenames, 259 char paths:

          Does it conform to reality?

          Maybe, maybe not. Who controls the matrix?? Neo?? Me :-D

          I mean, if the OP is to be believed (no reason to doubt him), he was able to open longer paths than the one “right on the border” that was giving him trouble.
          Of course, I tried his longer paths and couldn’t open those (Win10).

          Also curious about “really lengthening the limit” as described in your link.
          I wonder if it fully works for Notepad++.
          Meaning that the link lists API function names, does Notepad++ only use those? Likely not.

          Not sure one has already bothered to test this…

          Of course I’m sure that N++ source code is full of usage of MAX_PATH in declaring buffer sizes for paths, anyway…

          Yeah, currently, 278 matches found.

          1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @mere-human
            last edited by

            @mere-human said in Can’t open files with 103 char filenames, 259 char paths:

            Ok I see. Can somebody create an issue on GitHub? Or maybe, there is one already.

            I thought that someone had during the old discussion I linked to, but I couldn’t find one. I searched for “long path” in the issues, and found https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9181 , which appears to be related. I added links to this topic and the other one I mentioned in the issue.

            1 Reply Last reply Reply Quote 2
            • M Andre Z EckenrodeM
              M Andre Z Eckenrode @Ekopalypse
              last edited by

              @Ekopalypse said in Can’t open files with 103 char filenames, 259 char paths:

              I am not able to create longer filenames, windows7 refuses to let me do that.

              Confirmed here, when using Windows Explorer I am neither able to copy files with names longer than 103 characters to my long T:\ path, nor rename them to longer names in place. For the record, the file manager I normally use is Directory Opus, which is evidently able to do both.

              Note that once these files have been created/copied-to/renamed in DOpus, I can open an Explorer window, navigate to their location, and they are all correctly displayed there. Noteably, I can drag-and-drop all but the 103-char-name file onto my NPP window, and they open.

              Also, noteably, in the current phase of this test, NPP will NOT open the 103- or 104-char-name files when drag-and-droppped from DOpus, but it DOES open the 104-char-name file via Ctrl+O. All longer filenames I’ve tried open by either method so far.

              I should also mention that every long filename+path I’ve tried so far has successfully been opened in regular Windows Notepad.

              Would it be useful for me to 7-zip my batch of test files (103–110 character names) in their long path and upload it somewhere?

              @Alan-Kilborn said in Can’t open files with 103 char filenames, 259 char paths:

              I tried his longer paths and couldn’t open those (Win10).

              Just clarifying: You were able to create/copy/rename to longer filenames, but not open in NPP? Did you try both drag-and-drop and Ctrl+O?

              Alan KilbornA 1 Reply Last reply Reply Quote 3
              • EkopalypseE
                Ekopalypse
                last edited by Ekopalypse

                @M-Andre-Z-Eckenrode

                Uploading, not sure if that help here but might be helpful for the git issue.
                Curious, can you check your LongPathsEnabled registry key from
                HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem ?

                M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @M Andre Z Eckenrode
                  last edited by

                  @M-Andre-Z-Eckenrode said in Can’t open files with 103 char filenames, 259 char paths:

                  Would it be useful for me to 7-zip my batch of test files (103–110 character names) in their long path and upload it somewhere?

                  Probably. How about the most-appropriate issue that @PeterJones cited.

                  You were able to create/copy/rename to longer filenames, but not open in NPP? Did you try both drag-and-drop and Ctrl+O?

                  I did try both drag-and-drop and File > Open (dialog) approaches, but probably not on rigorously on each and every file. Just did some spot-checking.

                  My directory manager program (XYPlorer) colors in red paths that are “too long”. Interestingly, your original complaint file it leaves non-red but one character longer and it colors it red.

                  I suppose Notepad++ could have trouble with your original file because…and this is a big MAYBE…it might declare buffer[MAX_PATH] instead of buffer[MAX_PATH+1]. The +1 being some fudge room for a C-string null-terminator. OK, my C/C++ days are coming flooding back now, so before I get into trouble I’ll stop. :-)

                  1 Reply Last reply Reply Quote 2
                  • EkopalypseE
                    Ekopalypse
                    last edited by

                    @Alan-Kilborn

                    but that is what notepad++ should do accroding to MS documents. To quote:

                    In the Windows API (...), the maximum length for a path is MAX_PATH, which is defined as 260 characters.
                    and further
                    For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage.

                    I hope my math 3+256+NUL = 260 is now correct. :-D

                    1 Reply Last reply Reply Quote 4
                    • M Andre Z EckenrodeM
                      M Andre Z Eckenrode @Ekopalypse
                      last edited by

                      @Ekopalypse said in Can’t open files with 103 char filenames, 259 char paths:

                      Curious, can you check your LongPathsEnabled registry key from
                      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem ?

                      No such key exists on my Windows 7 system, and I don’t believe it’s supported until Windows 10, version 1607. See:

                      https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

                      Alan KilbornA 1 Reply Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @M Andre Z Eckenrode
                        last edited by

                        @M-Andre-Z-Eckenrode said in Can’t open files with 103 char filenames, 259 char paths:

                        No such key exists on my Windows 7 system, and I don’t believe it’s supported until Windows 10, version 1607

                        So then really there’s not much for you as a Win7 user to say about your original “problem”, I think. It’s a limitation of the OS, not Notepad++, that you can’t open your really-long-named files.

                        M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 0
                        • M Andre Z EckenrodeM
                          M Andre Z Eckenrode @Alan Kilborn
                          last edited by

                          @Alan-Kilborn

                          Point taken, but they were all successfully opened by the OS’ own Notepad, and most of the files >103 characters were even opened by NPP. Anyway, I’m really not hell-bent on having such long filenames and paths on my computer, but since there was considerable inconsistency, I thought there might be something else at play. Either way, it would be nice if NPP told why it couldn’t open them. Not the end of the world, of course.

                          .

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors