File length

All your suggestions, requests and ideas for future development
Post Reply
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

File length

Post by ChefGregS »

Didn't see this anywhere....sure it's somewhere cause I can't be the first person to think of this....but,

How about a WARNING popping up if a file name LENGTH is going to violate the rules of the system Filebot is running on?

I ran into this problem and didn't even catch it (months ago) until today when I went to play a movie I know I had. Plex wasn't showing it yet I know it had been there before. Sure enough, it's in the folder for my movies. But nothing I did (plex dance, even delete and install NEW version of the movie) would make Plex see the movie. I was baffled. I know it had been there before on Plex. Then I got to thinking....

I am always tweaking my file name format in FileBot. And I ran ALL my movies through the new version a few months ago. FileBot was happy to rename it in my new format. However, I didn't realize that because of my format the actual name is too long. And, on top of Plex not seeing the file, when I tried to play it directly in the system, it said the file was corrupt. I couldn't even drag it out of the folder. I ended up deleting it and getting a new version (worked for me, went from 720 to 1080 so all good...) however, this new version also came up corrupt. However, it played fine BEFORE I ran it through FileBot. Now I am totally confused.. Ran several other files through FileBot and they showed up fine in Plex and played. I did a full drive scan (took a couple hours) thinking maybe there was a bad sector that the stupid movie kept trying to occupy. It came out fine. Now I am scratching my bald head (couldn't pull out my hair) and totally in the dark....

Then I was staring at the movie folder inside my Movies folder.. Seemed that the name of the folder was longer than any other folder in there. Since the file name is the same as the folder, now it would be 2 times that length PLUS all the other stuff I have added to the name. I renamed the FOLDER it was in, and then the movie played. BINGO!!!!!! Because I didn't want to ruin my FileBot movie format I simply hand renamed all the files in the series (3) to eliminate part of the name.

Here is my format:

Code: Select all

{vf == /2160p/ ? 'L:/Movies 4K' : vf =~ /1080p|720p/ ? 'M:/Movies HD' : 'M:/Movies'}/{n.upperInitial().colon(' - ').replace('?', '!')} {' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|redux/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'} {any{' Part '+pi}{null}} ({y}) {fn.match(/3D/)}/{n.upperInitial().colon(' - ').replace('?', '!')} {' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|redux/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'} {any{' Part '+pi}{null}} [{y}, {any{csv('M:/replacecert1.csv').get(certification)}{certification}{"NR"} }, {runtime} Min] {[actors.take(3).join(', ')]} {[genres.take(3).join(', ')]} [{fn.match(/3D/)+', '}{"$vf, $ac@$af"}]{subt}
The issue was the movie The Lion, The Witch and the Wardrobe. Running that movie through FileBot results in this:
M:\Movies HD\The Chronicles Of Narnia - The Lion, The Witch And The Wardrobe (2005)/The Chronicles Of Narnia - The Lion, The Witch And The Wardrobe [2005, PG, 143 Min] [William Moseley, Anna Popplewell, Skandar Keynes] [Adventure, Family, Fantasy] [1080p, AAC@2ch].mp4
Thus, my fix was to manually remove "The Chronicles Of Narnia - " from the file name itself. I simply did it for all 3 in the series simply for continuity sake as the other 2 movies play just fine.

So, if FileBot would toss up a warning about a name being too long, that would be nice thing. Even better if it would then allow you to EDIT the name on the fly. In other words, in my case, show me the NEW file name as it does now, but offer to let me EDIT it. In my case, I would just remove "The Chronicles Of Narnia - " from that particular file (would be different in any case that it was an issue.)

Anyway, can't imagine I'm the first person to have this issue... but then again, who knows...I do some strange things....it's why I beta test many programs and games for companies....I have a way of wanting them to do what they were never meant to do....thus finding stupid issues that no one else should ever happen across...but MAY. :)

- Greg
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: File length

Post by rednoah »

If the file path was too long, FileBot would not be able to rename the file in the first place, since the file system wouldn't be able to perform the operation. The NTFS limit is somewhere around 32.000 characters per file path. You're not hitting that. But it's complicated for historical reasons, because there's a very old limit of 260 characters per file path, which some old Windows APIs enforce.

If Plex can't read files if the path is longer than 260 characters, then it's a Plex issue. Maybe they changed something and accidentally broke something. It's normally no problem to write long file paths with Python. Newer versions of Windows 10 also don't enforce this arbitrarily low limit anymore, though you might run into issue with Windows 7 when manually copying / moving files in Explorer.

:arrow: https://docs.microsoft.com/en-us/window ... ing-a-file
:idea: Please read the FAQ and How to Request Help.
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Re: File length

Post by ChefGregS »

Sorry if this seems rather long and boring....I'm trying to just make sure I have given you and others all the information I possibly can on this.

I would agree about it being a Plex issue, except that anytime I tried to run the file directly in the system (double click to play) VLC would tell me the file was corrupt. Windows 10, for its part, would also not allow me to do anything with the file. I couldn't even move the file, say from it's home folder "M:\Movies HD\The Chronicles Of Narnia - The Lion, The Witch And The Wardrobe (2005)/" to my desktop. It simply won't do anything. And when I would delete it wouldn't move it to the trash, it asked me to permanently delete the file. I had never had a file act like this before.

I just did an experiment. I took another movie with a somewhat longish name and ADDED X's to it. I did this to both the folder name and then the file name. To see what was up. Here are my results:

Originals:
Folder: 101 Dalmatians II - Patch's London Adventure (2003)
File: 101 Dalmatians II - Patch's London Adventure [2003, G, 70 Min] [Barry Bostwick, Jason Alexander, Martin Short] [Animation, Family] [1080p, AAC@2ch].mp4

[Folder = 51 characters, File = 151]

Renamed Folder: 101 Dalmatians II - Patch's London Adventurexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (2003)
[Folder = 82 characters]

At 82 for the folder the system will NOT allow me to rename the file by adding characters to it. So with 82 for the folder and 151 for the file the movie still plays in VLC. And I can't add anything to the file name.

I then, for giggles, added MORE X's to the folder name. I increased it to 90 characters. Now, oddly enough the system allowed me to add to the movie name. I added 5 more x's to it making it 156 and the movie played with no problems. So now, I am totally baffled. So, I reduced the folder back to 82 and the movie still plays. I could add 7 more to the movie name (now 163) and it wouldn't allow me to add any more. Movie still plays. Added 1 to the folder name making it 83 and now it won't allow me to edit the file name at all. I can't add, remove, nothing..... And the movie shows up as corrupt in VLC.

Folder = 83
Movie = 163
Movie shows up as corrupt in VLC, I can't rename the MOVIE FILE and I can't delete to trash or move to another location.

Deleted one from the folder name, so Folder = 82, Movie = 163 and movie plays fine. I can DELETE what I added to the movie name but I cannot ADD anything to it.

At this point I stopped testing... So while the limits seem to fluctuate based on the length of either folder or file name...there does in fact appear to be a limit for the system.

I am running:

Windows 10 Pro X64 i7-2600K with 16G RAM
Running Evaluation build 17744.rs5
(I am in the dev testing program)

I am going to post a copy of this all to them as well.

Maybe someone else could run a couple tests on their windows 10 system and see if they get similar results. Would be interesting to know.

- Greg
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: File length

Post by rednoah »

Could you try this and see if this somehow magically makes all your programs work with long paths?
Naming Files, Paths, and Namespaces wrote: A registry key allows you to enable or disable the new long path behavior. To enable long path behavior set the registry key at

Code: Select all

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled (Type: REG_DWORD)
. The key's value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (list follows). The registry key will not be reloaded during the lifetime of the process. In order for all apps on the system to recognize the value of the key, a reboot might be required because some processes may have started before the key was set.

The registry key can also be controlled via Group Policy at

Code: Select all

Computer Configuration > Administrative Templates > System > Filesystem > Enable NTFS long paths
https://docs.microsoft.com/en-us/window ... ing-a-file
:idea: Please read the FAQ and How to Request Help.
Post Reply