Filename is too long

For general rambling.
Post Reply
Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Filename is too long

Post by Jonathan »

softsdvia32-func_ms-windows-media-audio-encoder_tough51-64kbps-1pass_v9r10-beta_winxp_msvc-dot-net-13-00-9466_wmt_ssg_0301_007.wmt^softsdvia32-func_ms-windows-media-audio-encoder_tough51-64kbps-1pass_v9r10-beta_winxp_msvc-dot-net-13-00-9466_wmt_ssg_0301_007.wmt.log

266 characters, baby. Now I gotta figure out how to truncate that in a meaningful fashion.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Linux 2.4 kernel wrote:#define EXT2_NAME_LEN 255
Stupid 255 character limit.

Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

Post by Peijen »

you could probably take out _- and get it to 255

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Yeah, that's pretty much what I wound up doing. I guard against removing _- next to numbers, though, because I want to preserve the numbers. I also have to allow for the possibility of new files with the same base plus a new extension being created. I determined that the longest file name extension we commonly use is 37 characters long, so to trim it that long I am deleting letters in the middle of words.

Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

Post by Peijen »

you also have filename^filename.log

you could make it filename.log

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Unfortunately, there is meaning in the repetition. There's a proposal on the table to change the format to filename^2t.log, but for now all our scripts only recognize the filename^filename.log format.

quantus
Tenth Dan Procrastinator
Posts: 4891
Joined: Fri Jul 18, 2003 3:09 am
Location: San Jose, CA

Post by quantus »

Why the heck are they trying to store so much information in the filename in the first place?!?! Since most of the filename is the options, dump that info into a comment or something at the head of the file so it's identifiable if renamed. Then rename everything with unique short names and make a hash out of new names with the key as the long name. Stick the hash in between all calls for files and you're done. Of course, if you used poor programming style, then you won't be able to change your file handling routine to use the hash and will instead have to do it at EVERY instance of an open or close. I'd think this would be preferable in the long term to just hacking in a ^2t or some such.
Have you clicked today? Check status, then: People, Jobs or Roads

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Why long filenames? The short answer is it is a convention spiralling out of control.

The long answer is we don't have a program which parses this file. We also don't have a file. This file naming scheme is used to group a variety of completely different files into a logical whole. This group of files is then parsed and processed by an assload of connected scripts.

The convention came about because people were naming files stuff like 147vo_12893749_82_20000.log, which made no sense to anyone. Quite sensibly, they defined a standard format which provided all the info anyone might ever want. Unfortunately, no one put any limits on the length of the fields. Eventually, the format was institutionalized because all filenames were produced by the same program. People felt compelled to put info in because the field was there, blank and waiting. Eventually, new and creative uses strained the limits of the system. They're now talking about changing it to a more sensible scheme which omits some of the useless information while still retaining the key info. However, that's an institutional change which takes forever to get consensus and takes forever to get implemented.

quantus
Tenth Dan Procrastinator
Posts: 4891
Joined: Fri Jul 18, 2003 3:09 am
Location: San Jose, CA

Post by quantus »

You have to love crappy conventions :P
Have you clicked today? Check status, then: People, Jobs or Roads

Post Reply