IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Closed TopicStart new topic
Using FB2K for correcting file names that are too long ?, Closed due to spam. Please PM a staff member to reopen.
swayzak
post Apr 13 2012, 21:54
Post #1





Group: Members
Posts: 214
Joined: 23-August 05
Member No.: 24082



Hi

I came across a weird problem today.

I have been running a music library from an ext USB driver (320GB+, mostly mpt3 files) for my Logitech Squeezebox devices.

Bought a nice new Win 7 64bit laptop today with a 750GB drive so tried to copy over the library.

Annoyingly approx. 113 mp3 files refused to copy because of filename length issues.

Don't understand why they can exist & be played from the USB drive on my old netbook, but there you go.

Is there an easy way I can use FB2K to identify all the culprits & shorten the filename lengths to circumvent this problem ?


thanks
Go to the top of the page
+Quote Post
derty2
post Apr 14 2012, 09:26
Post #2





Group: Members
Posts: 581
Joined: 5-June 11
Member No.: 91257



Before commiting to a massive copy/backup job, it is wise to check if any files exceed the default path length limit.

For NTFS and FAT filesystems, the default Windows path length limit is around 255-259 characters.
For NTFS and FAT filesystems, the length of the name of a single file or directory component is limited to 255 characters

For NTFS filesystems only, the theoretical maximum path length limit is actually around 32767 characters; but the Windows built-in copy programs do not give you control of these features.
But, there are some third-party programs which can control these features, and can set the max path length while copying;
one such program is a command line copy tool named XXCOPY (freeware and sharewrae versions available).

Here is an example command line of using XXCOPY to perform such a task:
CODE
xxcopy "E:\source folder" "G:\destination folder" /MD /YY /E /K /R /H /U0 /FF /I /VL /oB3 /oS3 /oE3 /oP2 /oX2 /Fo"G:\destination folder\log_copied.txt" /oN"G:\destination folder\log.txt"

Explanation of each XXCOPY command-line switch:
/MD            Makes destination directory before all other actions
/YY             Suppresses all prompts unconditionally; yes to everything; do not stop and ask me anything.
/E               Processes directories and subdirectories, including empty ones.
/K               Keeps the source attributes
/R               Allows overwrite or delete of read-only files
/H               Copies hidden and system files
/U0             Updates all files; ignores whether the file exists or not in destination.
/FF              Fuzzy filetime matching; allow matches within +/- 2 second range
/I                If destination directory does not exist and copying more than one file, assumes that destination must be a directory (no prompting).
/VL              Sets the maximum path length to 32767 characters if destination is an NTFS filesystem
/oB3            Log Output - Reports to screen and log file, brief command switch list
/oS3            Log Output - Reports to screen and log file, skipped file list (with the reason why skipped)
/oE3            Log Output - Reports to screen and log file, error summary with the system error code
/oP2            Log Output - Reports to log file, detailed command switch list
/oX2            Log Output - Reports to log file, excluded items list
/Fo<file>     Creates log file - listing of files which were successfully processed
/oN<file>     Creates log file - report of the job
 
 
 
Another way of managing this is to download a freeware tool named CutLongNames
CODE
http://www.replsoft.com/cutlongnames.html

It will search a specified folder (and all sub-folders) for files whose path length exceeds a specified amount of characters.
Once the list of found files is processed, you can cut them down to the specified size with one click; or manually edit each item in the list.
Go to the top of the page
+Quote Post
swayzak
post Apr 18 2012, 08:13
Post #3





Group: Members
Posts: 214
Joined: 23-August 05
Member No.: 24082



Many thanks

Is there a simpler method in FB2K e.g. a column code for listing music files in order of filename length ?

That would make it relatively simple to track down the 100 or so culprits which I can then rename in FB2K to shorten filename length.

This post has been edited by Frank Bicking: Apr 18 2012, 11:43
Reason for edit: Now with less fullquote.
Go to the top of the page
+Quote Post
derty2
post Apr 18 2012, 11:38
Post #4





Group: Members
Posts: 581
Joined: 5-June 11
Member No.: 91257



Yes it is possible to manage this information from within foobar2000.

Firstly, I would like to state that I am using Columns UI alternative user interface ("CUI"), and this allows me to create a custom column with conditional string colors,
i.e. if path is below 255 characters in length then display the string using normal color, if string exceeds 255 characters display the string in bright red.
As you may guess, having the option of coloring strings conditionally is a powerful visual aid, unfortunately the foobar2000 Default User interface ("DUI") does not have such features.

So... this is how to do it :

Create a custom column in your Playlist Viewer,

         and give it a name, eg: Path Len.

         and give it dimensions, eg: Width: 59 | Alignment: Centre

         and give it this Display script: $len(%path%)

Restart foobar2000 (to permanently set this new configuration).

Search your entire Media Library and create a custom playlist,

         @ foobar2000 toolbar -> Library -> Search

         @ Media Library Search window -> enter this query: ALL SORT DESCENDING BY "$len(%path%)"

         wait for list to fully populate...

         click button [...] -> Create Playlist

         close Media Library Search window

You now have a Playlist of your entire Media Library sorted by Path Length, descending with highest number at the top of the list (as can be seen in your Path Len. column).

Happy editing.
 
 
 
P.S. --- was there a need to quote my whole previous post !!!???
Go to the top of the page
+Quote Post
swayzak
post Apr 18 2012, 13:34
Post #5





Group: Members
Posts: 214
Joined: 23-August 05
Member No.: 24082



Many thanks

However this sorts by path length (rather than file length) doesn't it ?

Therefore by this method I may miss some overlong file names as their actual path length may disguise the true filename size ?

This post has been edited by Frank Bicking: Apr 18 2012, 13:43
Reason for edit: Removed yet another fullquote.
Go to the top of the page
+Quote Post
derty2
post Apr 18 2012, 14:01
Post #6





Group: Members
Posts: 581
Joined: 5-June 11
Member No.: 91257



Why do you care about the length of this argument? : $len(%filename_ext%)

You have a problem with copying items whose path length exceeds 255 characters.
The 'path length' includes the full path to the file.

E:\My Music\Rock\Sungrazer\(2011) Mirador\Sea.flac
this item has a length of 50 characters, and you get the info using this argument: $len(%path%)

Sea.flac
this item has a length of 8 characters, and you get the info using this argument: $len(%filename_ext%)

Why do you care about the number of characters in the music file?
It is irrelevant; you want to know about the length of the full path to the music file (which includes the music file itself).


P.S. -- Why do you enjoy fully quoting previous posts !!??

This post has been edited by derty2: Apr 18 2012, 14:16
Go to the top of the page
+Quote Post
swayzak
post Apr 18 2012, 18:35
Post #7





Group: Members
Posts: 214
Joined: 23-August 05
Member No.: 24082



Sorry - just being dim I guess.

I thought my issue was with the filename length specifically, rather than the path length.
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th August 2014 - 13:06