Jump to content

Hello Everyone,

 

     Is there a limit to the number of different file names that can be had in a single folder?

 

     I have an extensive library of movies and it currently hovers around 600-650 different movies in it but I'm worried about it growing because I still have a LOT of movies to still put in that library.  My concern: is there a limit as to the number of movies that I can put in that library?  I'm not worried about the amount of space the movies occupy but I don't want to screw up the thing by attempting to put more movies into the library by virtue of having too many file names.  Currently I'm using just the Windows 11 file manager to keep them in.  I have some of the movies stored in different folders within folders such as seperating all the John Wick, Pirates of the Carribean, Riddick, and others but I'm concerned about everything else.

 

Thanks,

 

Take care and good luck.

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/
Share on other sites

Link to post
Share on other sites

4 minutes ago, kb5zue said:

Hello Everyone,

 

     Is there a limit to the number of different file names that can be had in a single folder?

 

     I have an extensive library of movies and it currently hovers around 600-650 different movies in it but I'm worried about it growing because I still have a LOT of movies to still put in that library.  My concern: is there a limit as to the number of movies that I can put in that library?  I'm not worried about the amount of space the movies occupy but I don't want to screw up the thing by attempting to put more movies into the library by virtue of having too many file names.  Currently I'm using just the Windows 11 file manager to keep them in.  I have some of the movies stored in different folders within folders such as seperating all the John Wick, Pirates of the Carribean, Riddick, and others but I'm concerned about everything else.

 

Thanks,

 

Take care and good luck.

 

No, there is no limit that you can hit, I think the limit is like 4,294,967,295 folders

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473479
Share on other sites

Link to post
Share on other sites

As far i know there is no limit on a containing in a file but as a long file path there is. I dont know exact limit but path limit work like this :

This one ok : 
c:\users\username\desktop\4kmovie\iceage4.mp4
This one probobly wont work :
c:\users\username\desktop\4kmovie\animation\forkids\oldschool\snowy\downloads\completed\iceageseries\iceage4\mp4\iceage4.mp4

how its goin mate ? hope my post helps. Maybe drop a like or follow ? >w<

no ? i guessed that 😄

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473481
Share on other sites

Link to post
Share on other sites

There seems to be a limit of 4,294,967,295 files per folder with NTFS.

https://answers.microsoft.com/en-us/windows/forum/all/how-many-files-can-a-folder-hold/25368d4b-83e3-47b3-b7a3-a0fb8c7286a7

 

But on a more practical note, you might want to just create a folder for every movie and have all the associated files of that movie in that folder, like different versions, subtitles, etc. Both Jellyfin and Plex recommend this in their docs, if you want to use something like those apps to organize and watch your movies with.

 

https://jellyfin.org/docs/general/server/media/external-files/

https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files/

And now a word from our sponsor: 💩

ℑ𝔣 𝔶𝔬𝔲 𝔬𝔫𝔩𝔶 𝔫𝔬𝔱𝔦𝔠𝔢 𝔭𝔢𝔯𝔣𝔬𝔯𝔪𝔞𝔫𝔠𝔢 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔴𝔥𝔢𝔫 𝔶𝔬𝔲 𝔥𝔞𝔳𝔢 𝔞 𝔰𝔱𝔞𝔱 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔬𝔳𝔢𝔯𝔩𝔞𝔶 𝔞𝔠𝔱𝔦𝔳𝔢, 𝔶𝔬𝔲 𝔞𝔯𝔢 𝔪𝔢𝔯𝔢𝔩𝔶 𝔩𝔬𝔬𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔱𝔬 𝔟𝔢 𝔲𝔭𝔰𝔢𝔱 𝔬𝔳𝔢𝔯. 𝔗𝔲𝔯𝔫 𝔬𝔣𝔣 𝔱𝔥𝔢 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔟𝔢𝔣𝔬𝔯𝔢 𝔞𝔰𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔥𝔢𝔩𝔭 𝔞𝔫𝔡 𝔰𝔢𝔢 𝔦𝔣 𝔶𝔬𝔲 𝔰𝔱𝔦𝔩𝔩 𝔫𝔬𝔱𝔦𝔠𝔢.

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473482
Share on other sites

Link to post
Share on other sites

3 minutes ago, cekcons said:

c:\users\username\desktop\4kmovie\animation\forkids\oldschool\snowy\downloads\completed\iceageseries\iceage4\mp4\iceage4.mp4

This will be fine, the limit for paths are for the actual file name and its roughly 260 chars

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473484
Share on other sites

Link to post
Share on other sites

1 minute ago, ArushM said:

This will be fine, the limit for paths are for the actual file name and its roughly 260 chars

Thanks for correction - like i said i didn't know the exact limit but i want to give a somewhat idea about the limit.

how its goin mate ? hope my post helps. Maybe drop a like or follow ? >w<

no ? i guessed that 😄

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473485
Share on other sites

Link to post
Share on other sites

7 minutes ago, ArushM said:

I was close, thanks though

It stems from back when windows was created still funnily enough. The max path length is the length of 1 byte which is 256 chars. Why its only 255 in actuality is because 0 counts.

 

As IT I have to have a weekly discussion with people about not forever nesting folders and why files wont open after a certain point. Or why when copied to some other storage location that has 4 char longer name it is no longer working 😛

 

Always fun! Does force them to keep things sorta brief

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473497
Share on other sites

Link to post
Share on other sites

Yes, there are some limits. Most of the time, they're high enough you won't hit them in real world scenarios. 

 

FAT32 allows up to 65534 files and folders in a folder  (21-2 = 65534). NTFS allows millions. 

 

BUT, there are some limitations ... For example some older versions of network sharing support a reduced amount of file entries, like in the range of 400,000 entries or something like that.

 

Also, while a huge amount of files per folder is supported, you will notice NTFS will start to struggle once you go above some thresholds, because above some amounts, it can no longer cache stuff properly, and will also take more time to update metadata for an accessed file like last modified time, last access time, checking if there's a thumbnail or not etc etc.

 

From personal experience, once you go over around 6-10,000 files per folder, you will start to notice higher access time (more time to open a random file in the folder and read a chunk of it).  When you go above around 20-30k files in a folder, you'll really start to notice that things slow down. 

 

I've used a software called Offline Explorer Enterprise which is designed to download websites, and for example if you mirror a page /book/chapter1.php?page=10  it will create  /book/chapter1_php_page_10.html in the folder .... 


The programmers of the application added option to restrict the number of files per folder so they would monitor how many pages are retrieved and automatically create subfolders if a folder had more than 10k pages... ex  /book/~set001/chapter1_php_page10.html  and rewrite the links inside all downloaded html files to maintain the structure of the downloaded website. 

 

 

On Windows there's also a limitation about the length of the file name + file path.  

Originally (and for best compatibility) the total path including drive letter and everything should not exceed 260 characters. See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

 

 

ex C:\users\john\my documents\200+ characters filename.txt 

 

NTFS and Windows supports long path and file names, up to 32K characters (65536 bytes, but Windows uses UTF-16 internally where each "character" uses at least 2 bytes, so at most 32767 characters 

 

It's just that programs need to use the right windows functions to access and work with files that have longer than 260 characters in path names ... programs that use the old functions since the windows 95 times may not be able to open and use files that have total name + path length higher than 260

 

You can work around restrictions in file by using the \\?\ prefix which disables any preprocessing of file paths, so you can use it to create very long file names, or delete/rename files that have long file names to the point where total path goes over 260 characters

 

It also makes it possible to give files name that windows explorer won't let you, for example you could create a file that ends in dot - Windows explorer will insist you put an extension after the dot.

 

But you can say in command prompt   COPY CON \\?\C:\Temp\a.   and type a few characters followed by Ctrl+Z and copy will create the "a." file in the temp folder.  COPY is a file copy program, and I'm telling it to copy from CON (console, whatever you type next) into file "a." in the Temp folder and Ctrl+Z "types" a special character that means "end of file", stop and close the file.

 

If you try to open the file with Notepad, it won't open it, and windows explorer won't delete it ... but you can type in command prompt DEL \\?\C:\Temp\a.  and it will be deleted. 

 

See about file name length limitations here :  https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473522
Share on other sites

Link to post
Share on other sites

3 hours ago, cekcons said:

As far i know there is no limit on a containing in a file but as a long file path there is. I dont know exact limit but path limit work like this :

This one ok : 
c:\users\username\desktop\4kmovie\iceage4.mp4
This one probobly wont work :
c:\users\username\desktop\4kmovie\animation\forkids\oldschool\snowy\downloads\completed\iceageseries\iceage4\mp4\iceage4.mp4

Yeah that’s 255 character I think.

If a post resolved/answered your question, please consider marking it as the solution. If multiple answers solved your question, mark the best one as answer.

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473619
Share on other sites

Link to post
Share on other sites

8 minutes ago, anirudthelinuxwIzard said:

Yeah that’s 255 character I think.

it's only 124 characters

 

Just make a folder in the C: drive called 0123456789012345678901234567890123456789  - that's 40 characters  go in this folder, make another folder , go in that folder make another  ... 6 such folders = 240 characters , add c:\ and 5 slashes between the 6 folders and you're at 248 characters. Add the last \ between the folder and a file name, and you're at 249 characters.

 

Windows won't let you make another folder: 

 

image.thumb.png.f01671055ce4ba58feb3027d0cb6517d.png

 

If you try to make a file using New Text Document , you'll see that if you try to give any name, it won't accept it, because you have only 1 characters left until you hit 250 characters and Windows Explorer will try to append .txt to anything you type, and naming the file will fail. Windows Explorer has the cap at 250 characters, not 260... if my memory is correct. 

 

So your file names will get New Text Document.txt because the function that creates the file initially is aware of long paths 

 

If you hit properties  on the file , you'll see it lists the path with \\?\ in front :  

 

image.png.7a927fb08678dfd3d7e9b962ae0cbab8.png

 

 

You can make more folders and files  from command prompt using that \\?\ trick I mentioned above. 

 

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16473636
Share on other sites

Link to post
Share on other sites

  • 5 weeks later...

I use Nextcloud. I found out that when it is syncing to a PC. It can create file paths in windows that is longer than what Windows allows. Probably partly because the limit on Linux is higher.

 

I figured that out by having a PDF sync to my PC that didn't open properly and errors out when trying to move it with some kind of error that didn't say the path was too long. Took a little bit of time before I realized the path was too long and not that something was corrupt or something.

“Remember to look up at the stars and not down at your feet. Try to make sense of what you see and wonder about what makes the universe exist. Be curious. And however difficult life may seem, there is always something you can do and succeed at. 
It matters that you don't just give up.”

-Stephen Hawking

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16499682
Share on other sites

Link to post
Share on other sites

  • 1 month later...
On 7/23/2024 at 9:39 AM, jaslion said:

Its exactly 255 chars

 

As for file limit yeah I dont think we have that many movies in existance yet 😛

actually its

 

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 character.

 

i know cause i had to do that because PlayStation 3 OS doesn't have such lowly limits like windows default . 😉

 

On 7/23/2024 at 1:11 PM, mariushm said:

it's only 124 characters

 

"Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths"

 

however there's a catch, apps must support this new path length...  i would guess at least windows explorer would though?  

The direction tells you... the direction

-Scott Manley, 2021

 

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16535506
Share on other sites

Link to post
Share on other sites

You're quoting me out of context and make it sound like I was incorrect  .... I was saying the path that user posted had only 124 character, and then I gave an example showing the maximum length of a path by default (backwards compatible to DOS times) is 260 bytes ( 256 characters + drive letter + ":\" + nul character to indicate end of path )

 

Windows uses a special Unicode format that uses 2 bytes or multiple sets of 2 bytes for each character.  In total, a path can be represented using 216 bytes, because 16 bits are used to store the length. So, in total maximum 65536 bytes can be used to store the path, and because each character uses AT LEAST 2 bytes, in the best case scenario where every character uses only 2 bytes, then the maximum length will be 65536 / 2 -1 = 32767, because 0 is considered also a valid path length.

 

The option you mention just enables support for long path names, but applications still need to be aware of it and handle them.

 

 

Link to comment
https://linustechtips.com/topic/1577345-is-there-a-limit/#findComment-16536330
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×