Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#286546 - 08/09/2006 05:36 Windows filename question
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5546
Loc: Ajijic, Mexico
A bit of empirical testing shows me that the maximum filename length including full directory path in Windows XP seems to be 255 characters.

I have some very deeply nested files in my music directory. For example:

D:\_MP3\CLASSICAL\Composers A-B\Beethoven, Ludwig Van\Beethoven Sonatas for Piano\Beethoven Piano Sonata in C Minor\Beethoven, Ludwig van - Beethoven Piano Sonatas - 05 - Beethoven-Sonata in C Minor Op 111 1st Mvt. (Maestoso Allegro con brio ed appassionato).mp3

If you wanted to take the trouble, you would count that filename and path at 262 characters. While Windows won't allow one to create a filename that long, I believe that MP3 Tag Studio will. I am pretty sure that is how that filename came into being.

That file is in a directory with another similarly named file -- but the second filename (with directory path) is exactly 255 characters long.

Here is the problem:

Windows will let me play, change filename, delete, etc. the second file (the one tht is 255 characters long) but the first file (the 262 character file) I can do nothing with. Windows Media player will bring up the file, but it just sits there, doesn't play it. I can't rename the file, I can't delete the file, I can't do anything with the file except look at it in Windows Explorer. I can't do anything with it at a DOS prompt because of the spaces in the filename (I get invalid syntax error) and I don't know of any utilities currently in my computer that will work with it.

How can I re-name this file so Windows will work with it?

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#286547 - 08/09/2006 05:44 Re: Windows filename question [Re: tanstaafl.]
mac
addict

Registered: 20/05/1999
Posts: 411
Loc: Cambridge, UK
I believe that it's only FAT that is limited to 255 characters but many programs may have that limit too.

If you want to rename or move the file here's a trick I came across a few months ago:

At a command prompt enter something like:

subst x: d:\_MP3\CLASSICAL

You should then be able to access the file successfully through X: to do what you need to with it because the resulting path names will be less than 255 characters long.

You may also find that you can just move the file from the command line if you're sat in the directory.

Mike.

Top
#286548 - 08/09/2006 06:05 Re: Windows filename question [Re: tanstaafl.]
elperepat
enthusiast

Registered: 11/01/2002
Posts: 211
Loc: Qc, Canada
An other trick you can use is to rename temporarly one of the parent folder to shorten the whole path/name of the file to less than 255 characters. Then, you'll be able to rename the file. Once it's done, you can rename the parent folder to it's original name.
_________________________
Patrick

Top
#286549 - 08/09/2006 07:39 Re: Windows filename question [Re: tanstaafl.]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Another method is to use the Windows 8.3 versions of the file names i.e. something like

D:\_MP3\CLASSI~1\Compos~1\Beetho~1\Beetho~1\Beetho~1\Beethoven, Ludwig van - Beethoven Piano Sonatas - 05 - Beethoven-Sonata in C Minor Op 111 1st Mvt. (Maestoso Allegro con brio ed appassionato).mp3

You don't need to abbreviate everyone if you're only a few chars over. "dir /x" from a command prompt will give you the short versions since they won't always be ~1

Yes. Freakin' annoying. Programs will generally work if you are in the directory, but you can't access the full path. I have issues all the time on our server with this problem and my rsync backup.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#286550 - 08/09/2006 07:48 Re: Windows filename question [Re: mac]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Quote:
I believe that it's only FAT that is limited to 255 characters but many programs may have that limit too.


We covered this one a while ago.

Most applications (including Windows Explorer) use _MAX_PATH for their path name buffers. It's defined as 260, which is enough room for the C:\ part, 256 letters and the terminating NULL.

Which is odd, because FAT -- IIRC, and as you say -- only supports 255-character filenames.
_________________________
-- roger

Top
#286551 - 08/09/2006 09:26 Re: Windows filename question [Re: tanstaafl.]
furtive
old hand

Registered: 14/08/2001
Posts: 886
Loc: London, UK
You've got a whole load of redundancy in that path!

To fix it, open a command prompt and rename the "Beethoven, Ludwig Van" directory to a single character

That should make the path shorter so that you can rename the file to reduce its overall length.

I suggest:

D:\_MP3\CLASSICAL\Composers A-B\Beethoven, Ludwig Van\Sonatas for Piano\Piano Sonata in C Minor\05 - Op 111 1st Mvt.mp3

And use tags rather than file names on your MP3's
_________________________
Mk2a RioCar 120Gb - now sold to the owner of my old car
Rio Karma - now on ebay...

Top
#286552 - 08/09/2006 19:15 Re: Windows filename question [Re: furtive]
larry818
old hand

Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
I was thinking the same thing, "Beethoven" appears in the file name alone three times, and three times in the path.

I agree with furtive's naming convention, with the exception that I do like to have the artist information in the .mp3 file name as well.

Top
#286553 - 08/09/2006 23:32 Re: Windows filename question [Re: elperepat]
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5546
Loc: Ajijic, Mexico
Quote:
rename temporarly one of the parent folder to shorten the whole path/name of the file


Doh!

Of course.

Thanks for pointing out how dumb I am!

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top