1. Long File Names Support?
Okay, all you Euphoria wizards out there, how can I find out the 8.3 name
for a Win95 long file name so I can deal with it in DOS?
Example:
I have a directory with SomeLongFile.qrs, SomeLongerFile.qrs and
SomeFileThatIsTheLongest.qrs. I know the naming scheme is usually
SOMELO~?.QRS ... but how can I find out which one is SOMELO~1.QRS, etc.?
I know Euphoria supposedly supports Win95 long filenames (correct me if I'm
mistaken) ... so what can I do to find out? Can someone write a function
that can do this? If it supports wildcards, even better!
Thanks!
--
Cameron Kaiser
http://www.sserv.com/
spectre at sserv.com
--
2. Re: Long File Names Support?
- Posted by Jacques Deschenes <desja at GLOBETROTTER.QC.CA>
Jul 27, 1997
-
Last edited Jul 28, 1997
At 17:26 27-07-97 -0400, Cameron Kaiser wrote:
>I have a directory with SomeLongFile.qrs, SomeLongerFile.qrs and
>SomeFileThatIsTheLongest.qrs. I know the naming scheme is usually
>SOMELO~?.QRS ... but how can I find out which one is SOMELO~1.QRS, etc.?
>
>I know Euphoria supposedly supports Win95 long filenames (correct me if I'm
>mistaken) ... so what can I do to find out? Can someone write a function
>that can do this? If it supports wildcards, even better!
dos interrupt 21 function #71 and many sub function support translation for
long file
name to short file name and other usefull thing like that. Consult Ralph
Brown interrtupt list (best resource on the subject) for more information.
Here a function to translate from long file name to short one.
include machine.e
function LongNameToShortName(sequence lfn)
-- return dos 8.3 name of a long file name
sequence r, sfn
atom lfn_buffer, sfn_buffer
lfn_buffer = allocate_low(length(lfn)+1)
if not lfn_buffer then
return -1
end if
poke(lfn_buffer,lfn&0)
sfn_buffer = allocate_low(67)
if not sfn_buffer then
free_low(lfn_buffer)
return -1
end if
mem_set(sfn_buffer,0,67)
r = repeat(0,10)
r[REG_AX] = #7160 -- function #71 sub function #60 long name to short name
r[REG_CX] = 1
r[REG_FLAGS] = 1
r[REG_DS] = floor(lfn_buffer/16)
r[REG_SI] = remainder(lfn_buffer,16)
r[REG_ES] = floor(sfn_buffer/16)
r[REG_DI] = remainder(sfn_buffer,16)
r = dos_interrupt(#21,r)
free_low(lfn_buffer)
if and_bits(r[REG_FLAGS],1) then
return -1
end if
sfn = peek({sfn_buffer,67})
free_low(sfn_buffer)
return sfn[1..find(0,sfn)-1]
end function
puts(1,LongNameToShortName("c:\\program files"))
Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at globetrotter.qc.ca
3. Re: Long File Names Support?
On Sun, 27 Jul 1997 17:26:07 -0400 Cameron Kaiser <spectre at WWW2.BUOY.COM>
writes:
>
>I know Euphoria supposedly supports Win95 long filenames (correct me
>if I'm mistaken)
>
I read the documents for Euphoria.
It does NOT support Win95, NT filenames.
Robert DOES have plans to support them but hasn't
released support yet.
If you would like to know where I found this in the docs
Then search for "<dir", quotes not included.
It goes into detail about how to use dir() and
that Euphoria does not support Long filenames yet.
>Thanks!
Your Welcome !
>--
>Cameron Kaiser
>http://www.sserv.com/
>spectre at sserv.com
>--
>
--Lucius Lamar Hilley III
-- E-mail at luciuslhilleyiii at juno.com
-- I support transferring of files less than 60K.
-- I can Decode both UU and Base64 format.
4. Re: Long File Names Support?
- Posted by Cameron Kaiser <spectre at WWW2.BUOY.COM>
Jul 27, 1997
-
Last edited Jul 28, 1997
Thanks, Jacques!
That hit the spot. I'll look a little more into int71.
--
Cameron Kaiser
http://www.sserv.com/
spectre at sserv.com
--
5. Re: Long File Names Support?
Lucius Hilley writes:
> I read the documents for Euphoria.
> It does NOT support Win95, NT filenames.
> Robert DOES have plans to support them but hasn't
> released support yet.
> If you would like to know where I found this in the docs
> Then search for "<dir", quotes not included.
> It goes into detail about how to use dir() and
> that Euphoria does not support Long filenames yet.
Euphoria does support Windows 95 (but not NT) long filenames
as far as opening and using *existing* long filename files is concerned.
It's just that it won't let you create a *new* long filename file - it reverts
to 8.3.
Also, the dir() function only shows the 8.3 name, however
Francis Bussiere wrote an extended version of dir() that
returns both the short and long filename for each file.
The code is on the Euphoria Recent Contributions page
"Enhanced dir() Function" May 31.
The WIN32 version of Euphoria will support
long filenames in every possible way.
Regards,
Rob Craig
Rapid Deployment Software
6. Re: Long File Names Support?
> I read the documents for Euphoria.
> It does NOT support Win95, NT filenames.
> Robert DOES have plans to support them but hasn't
> released support yet.
In DIR() documentation it's said that Euphoria has PARTIAL support
for long filenames.
You can call DIR() with a long filename/path under Win95, but the
returned filenames are in 8.3 format. Something similar applies for
OPEN(), you can specify a long filename/path for an EXISTING file,
but for creating a new one ("w" mode) you must give a standard 8.3
name.
In conclusion: Euphoria (up to version 1.5) allows you to access
EXISTING long filenames under Win95/NT, but not to create NEW long
filenames (this applies to directory names too).
Regards,
Daniel Berstein
danielberstein at usa.net
http://www.geocities.com/SiliconValley/Heights/9316