NT Extended File Names (AREV Specific)
At 26 FEB 1999 11:51:44AM Dan Manning wrote:
With the advent of Windows 95 and the NT server, our server can now utilize file names longer than 8 characters. Is there a way in ARev 3.12 to create a file with an extended file name? Under all the tests I have done, ARev truncates the extended file name to 8 characters.
At 27 FEB 1999 02:30AM Eric Emu wrote:
AREV only supports the plain DOS 8.3 naming convention. I'll look into designing AREV objects which create longer file names for you.
Eric
At 28 FEB 1999 02:55PM Eric Emu wrote:
The safest bet would be to use a function which accepted your long filename as a parameter, created a zero byte file with that name, then returned the corresponding 8.3 filename for use by native AREV.
eg.]
filename8.3 =createlongfile("c:\verylongfilename")
* filename8.3 is thus set to "c:\verylo~1"
Does this suit your requirements?
At 28 FEB 1999 03:59PM Capt'n Kirk wrote:
]]filename8.3=createlongfile("c:\verylongfilename")
]]* filename8.3 is thus set to "c:\verylo~1"
Great idea. But if there exists another similar name, like "c:\verylongverse" it will be identified as "c:\verylo~2"
There's no control on the numeric allocation.
At 28 FEB 1999 09:13PM Eric Emu wrote:
David,
That's why the function returns the 8.3 name, so that AREV can then OSOPEN and manipulate the correct file. Getting a short 8.3 filename from the long is reasonably easy.
As for getting the long filename given the 8.3 name, that's another (harder yet not impossible) problem. The long file name is stored in the FAT entries adjacent to the 8.3 filename FAT entry. The longfilename can use one or more FAT entries, depending on its length. Any code to do this will have to negotiate NTFS and FAT volumes differently.
Windows 95,98 & NT store the long filenames in unicode, not ASCII, which adds a little more complexity to the exercise.
If the long filename doesn't exist, the AREV utility it creates it (zero bytes), and returns the 8.3 name. If the long filename exists, the function returns the 8.3 name for AREV to use subsequently.
Eric
At 28 FEB 1999 09:41PM Victor Engel wrote:
All this is possible to do with standard Arev tools, albeit clumsily. The key is to PCPERFORM DOS commands:
1. Create the file using OSWRITE
2. PCPERFORM 'ren …
3. PCPERFORM 'dir … (pipe this output of this command to a DOS file
4. Parse the piped file to retrieve short and long names.
At 01 MAR 1999 12:11AM Eric Emu wrote:
Make sure you have made a full backup before trialling this code.
It has been tested under Windows 95, and using Novell 4.x.
$MAKELFN is a utility to to create files with
long file names. The function returns the short
file name alias which AREV can then use. If the
long filename already exists then the function
simply returns the short filename to use, without
creating anything.
- Eric
To create the object, run the following code:
A=\02000000000000000000E92F02FF4D41\
A:=\4B454C464EFF436F7079726967687420\
A:=\28632920313939392062792045726963\
A:=\20456D752EFF00000000000000000000\
FOR I=1 TO 31
A:=\00000000000000000000000000000000\NEXT I
A:=\0000000000000000000000002EC7063E\
A:=\0200000E1F0E07BB3C01BE3A00B90001\
A:=\C60700C604004346E2F6B40DBA01002E\
A:=\FF1E0A00BF3A00F3A40E1FB86C71BB02\
A:=\00B90000BA1100BE3A00BF0100CD2172\
A:=\512EA33A01B43E2E8B1E3A01B86071B1\
A:=\01B580BE3A00BF3C01CD217235BB3C01\
A:=\8A1780FA007408432EFF063E02EBF1BE\
A:=\3C012E8B0E3E02B40F2EFF1E0A0057F3\
A:=\A45F2E8B0E3E0233C033D2B4102EFF1E\
A:=\0A00CB\
OPEN 'BP' TO BP.FILE THEN
WRITE A TO BP.FILE, "$MAKELFN"END
* Remember to catalog $makelfn
* Syntax:
DECLARE FUNCTION MAKELFN
SHORTNAME=MAKELFN("C:\Thisisaverylongfilename")
OSOPEN SHORTNAME TO HANDLE THEN
whatever you need to do goes hereEND
At 01 MAR 1999 03:50PM Dan Manning wrote:
Eric:
Thanks for your suggestions. I appreciate your offer to create an ARev object, but I may not need it at this point. One of my fellow programmers has taken your comments and the approach suggested by Victor Engel to develop an RBasic program. He is working through complications with existing file names.I had failed to mention in my initial inquiry that we will be using the extended names in conjuction with the PDisk.
At 01 MAR 1999 04:23PM Eric Emu wrote:
Dan,
Good to see you've got several ways forward. Your programmer might also be interested in LFNDIR.EXE, a PC Magazine utility to list long filenames from DOS.
Eric Emu
"I like hex - it's better than sex"