Short and long files names

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Short and long files names

Post by gtisdale »

I have run into a problem. If I use a long file name that is longer than 8 characters then the short name is converted to a 6character name with a ~1 etc at the end. If the name is longer than 32 characters BR truncates the name at 32 characters.

The problem arises when I try to use a FREE command (or an exists) to locate and get rid of the file. The tilde is translated to a "not" in the command and a dir fails with a 4152 error, exists returns 0. To get rid of the file I have to drop out to the system and do a delete at the system level.

I do notice however, if I know the full file name, rather than using the one returned by BR that the BR DIR command will find it.

PErhaps my solution is to use the system DIR command ratrher than the BR dir command to get the list of files to start with.

Any suggestions?

Long file name
a01_6ndisclosurechecklistnot-for-profit.txt

BR long name
a01_6ndisclosurechecklistnot-for

BR short name
a01_6n~1.txt
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Post by John »

Dir -B will let you get names that are much longer than 32 characters...

I believe it is the official solution...

If I'm not mistaken
Dir -B >File.txt
will even give you more than 80 characters per name (while only 80 without redirection)

-John
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

I've run into this before as well, and I solved it much the same way as you suggest - by using the O/S "dir" instead WHEN I KNOW that I have filenames longer than 32 bytes OR where users are allowed to create their own data files.

But in almost all cases, my long file names in PROGRAM directories are less than 32 bytes. I have a program that sends a dir list to a file and then operates on each file in the folder in a loop. In that program (since I already know that no filename is longer than 32 bytes), I use the BR dir command (which will give me both the short and long name) and then I snag the longname rather than the short one. But that works because the filenames are less than 32 bytes.

fdrfundb wb 35077 03/25/10 9:53p fdrfundb.wb
Fdrlet~1 wb 26095 07/13/09 7:16p fdrletters.wb
fdrnpost wb 17914 07/13/09 7:16p fdrnpost.wb
Funden~1 wb 57216 07/26/09 4:39p fundenroll.wb
Fundun~1 wb 46497 07/26/09 4:40p fundunenroll.wb

-- Susan
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

John,

I didn't know about -B. I will have to experiment with that. Thanks.

-- Susan
Post Reply