# Do files with long names screw up a computer?

**URL:** <https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429>\
**Category:** Factual Questions\
**Created:** [April 10, 2023, 12:25am UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429 "2023-04-10T00:25:40Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![md-2000](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@md-2000](https://boards.straightdope.com/u/md-2000)\
**Post date:** [April 10, 2023, 9:52pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/21 "2023-04-10T21:52:25Z")

</div>

> [@AHunter3](#):
>
> Create a file with a longish filename, like “October 2017 thru December 2019 Single-Encounter Purchases, New Clients\_final.pdf”. Process it (e.g., type the contents of it into a database or whatever) and then file it by dragging it to \Shared\2019\PostProcessing\DataEntry\Done; it may let you do so but then won’t subsequently let you open it in Adobe Acrobat or rename it, because the total file path is too freaking long for Windows to cope with.

I used to help a business that had that same habit in the Windows 7 days. They were far too descriptive in their file names, and it took a few incidents to train them to not use such descriptive names and not make files go so deep in their folder tree. Typically, they would take “Minutes of board meeting April 10, 2015” from their personal store and put relevant files into it, and later move it to “Company board Meetings of 2015” which was arbitrarily deep in their entire server document store. There were several things at work here - the original folder was easy to construct, because wordy doc titles in it did not violate the limit. Moving the folder by name did not violate the structure, because it simply moved the folder as is, rather than digging deeper one file at a time. But the programs attempting to retrieve a file would try to specify the full file path and hit the limit. i presume that’s because the program calls the rlevant Windows system process and tries to tell it the full file name - greater than the max buffer space allocated - whereas moving the folder before that simply told the relevant window call “move this folder to here” and neither item itself violated the buffer limit.

The solution was to rename folders and/or files (as others mention) to things like “Board2015” to get below the limit. You can rename a folder whose full path does not exceed the name limit, thus causing the full path of the included files to now be below the limit.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [April 11, 2023, 12:21pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/22 "2023-04-11T12:21:36Z")

</div>

> [@md-2000](#):
>
> i presume that’s because the program calls the rlevant Windows system process and tries to tell it the full file name - greater than the max buffer space allocated -

If, as some have said, the problem is just in specific apps, then I suspect that whoever wrote that app just allocated a static string of some specified finite length to hold the file name, something like

```auto
char filename[256]
```

because they figured that 256 characters would be enough for anything.

---

<div class="post-metadata">

**Author:** ![Francis\_Vaughan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/francis_vaughan/32/3093_2.png) [@Francis\_Vaughan](https://boards.straightdope.com/u/Francis_Vaughan)\
**Post date:** [April 11, 2023, 1:20pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/23 "2023-04-11T13:20:14Z")

</div>

Most Unicies seem to use MAXNAMLEN = 255 as the limit for any individual name, with a total path name of 4096 for Linux and 1024 for others. But it is rubbery. So, whilst contrived, it isn’t difficult to get into trouble. Windows and MacOS similarly are 255, again, this is just the file name, not the path. On Windows that 255 is Unicode characters, not ascii. 1024 is the max path length on Mac and Windows.

---

<div class="post-metadata">

**Author:** ![CaveMike](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cavemike/32/16379_2.png) [@CaveMike](https://boards.straightdope.com/u/CaveMike)\
**Post date:** [April 11, 2023, 2:06pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/24 "2023-04-11T14:06:25Z")

</div>

Historically Windows has MAX\_PATH which is set to 260 (255 characters for path, 3 for drive spec, and 1 for a terminating null).

32-bit Windows has an extra layer that Unix and Linux do not: the Win32 API, the NT native API, and the underlying file-system. This made it possible to replace the Win32 API with a POSIX, but it also added some mostly unutilized complications.

With NT and 32-bit Windows, they added support for paths of 32k 16-bit Unicode characters. There were two sets of functions and UX dialogs. One for backwards compatibility and one for the wide char support.

This created a situation where one program could create a crazy filename that other programs could not modify. IIRC, even Explorer used the old API. This was a common exploit for viruses.

I haven’t programmed Windows in a long time (Vista or XP) and I’m not sure how it is handled in 64-bit Windows, but as a user I still see a variety of File Open dialogs in old apps. It’s entirely possible that 32-bit Adobe is using a less powerful API.

---

<div class="post-metadata">

**Author:** ![Fridgemagnet](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Fridgemagnet](https://boards.straightdope.com/u/Fridgemagnet)\
**Post date:** [April 11, 2023, 6:47pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/25 "2023-04-11T18:47:05Z")

</div>

I had this very issue a few days ago, with Excel file names on a corporate laptop running Win 10 - I couldn’t rename the files (unless the name was very short), and I couldn’t open the offending files. The temporary workaround was to move everything to a folder named C:\Temp\ and work on them there. I did find a registry edit solution ([How-To Geek](https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/)) but it didn’t stick for me as it required a reboot, and some corporate boot script or other changed the registry back again. Win 10 registry settings aside, there is a 218 character limit to Excel file paths ([Microsoft](https://support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3)), which seems to be there so links between Excel documents don’t get broken by a file path length that Excel can’t handle. There are crafty ways of concatenating cells in Excel to get around some of these limitations, but that sounds like a right faff, I’ll either try and keep the file path short or move things to a snappily-named folder in C: root.

---

<div class="post-metadata">

**Author:** ![falokunolaitan](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@falokunolaitan](https://boards.straightdope.com/u/falokunolaitan)\
**Post date:** [April 16, 2023, 9:07am UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/26 "2023-04-16T09:07:25Z")

</div>

It is not by words, it is by characters and the limit is 256 characters. You will face problems when you exceed this limit and try to copy or delete files with long path names, and this can be handled by tools like Long Path Tool or Gs Richcopy 360

---

<div class="post-metadata">

**Author:** ![Mk\_VII](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Mk\_VII](https://boards.straightdope.com/u/Mk_VII)\
**Post date:** [April 16, 2023, 11:05am UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/27 "2023-04-16T11:05:52Z")

</div>

I often bump up against this at work, and have to change or shorten folder/file names.

---

<div class="post-metadata">

**Author:** ![falokunolaitan](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@falokunolaitan](https://boards.straightdope.com/u/falokunolaitan)\
**Post date:** [April 16, 2023, 12:43pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/28 "2023-04-16T12:43:54Z")

</div>

Yes , shorten the long paths is best and workable solution for this issue , but it still a headache if you have for example 1000 path or more

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [April 16, 2023, 12:55pm UTC](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429/29 "2023-04-16T12:55:15Z")

</div>

> [@AHunter3](#):
>
> At least once a month I have to rename some folders to single-character filenames to be able to move or rename one of the files within them. Because they got dragged into a folder after processing that, in conjunction with the filename itself, makes the path too long. Can’t open the file. Can’t rename the file. Can’t delete the file. (Oddly one can COPY the file to the Desktop and open it there, but doing so leaves the original file, and the problem, intact).

I wonder if the issue here might be that you’re saving the file to a shared filesystem that has different constraints than your local machine.

> [@Velocity](#):
>
> Yes, but not quite just that - I mean it sends me to folders I’ve _never_ been to before.

I wonder if part of the problem here might be spaces in your file/folder names. Supposedly most modern operating systems handle them gracefully, but there I’ve seen a number of apps and network attached storage devices that don’t.

This has bitten me enough times that I simply don’t use spaces in file or folder names. I just don’t have a strong enough need for “friendly” names to justify the hassle of occasional weird glitches.

[Previous page](https://boards.straightdope.com/t/do-files-with-long-names-screw-up-a-computer/982429.md?page=1)
