Board index » delphi » accessing long filenames in win95

accessing long filenames in win95

Anyone have any pascal routines to enable one to access these from dos under
win95 (eg using bp7). The info is obviously stored on the disk somewhere &
programs like doslfnbk seem to able to find it!

Alternatively, anyone know how it's done?

----------------------
John Lee, tel +44 (0)171 446 4357, fax +44 (0)1932 869103
Space Division, Logica UK Ltd
l...@logica.com ---opinions are mine---

 

Re:accessing long filenames in win95


Quote
john lee wrote:

> Anyone have any pascal routines to enable one to access these from dos under
> win95 (eg using bp7). The info is obviously stored on the disk somewhere &
> programs like doslfnbk seem to able to find it!

Win95 long filename services can be accessed via INT $21, AX=$71xx,
*PROVIDED*
that the IFS driver is installed. This is true if you are running in a
Win95
DOS box, but not if you boot into MS-DOS mode. A complete description of
the INT $21
services can be found in Ralph Brown's Interrupt List
(ftp://garbo.uwasa.fi,
in /pc/programming/inter*.zip - I think...)

If you intend to run your application in MS-DOS mode then you will need
to do
low-level access to the hard disc to read the long filenames- I can't
help you
with that. Otherwise I (along with the result of the world and their pet
dogs ;-))
have a small unit to do the grotty work; I can e-mail this to you if
it's what
you're looking for.

Chris.

Re:accessing long filenames in win95


In article <5d4vcf$...@romeo.logica.co.uk> of Mon, 3 Feb 1997 15:14:46
in comp.lang.pascal.borland, john lee <l...@logica.com> wrote:

Quote
>Anyone have any pascal routines to enable one to access these from dos under
>win95 (eg using bp7). The info is obviously stored on the disk somewhere &
>programs like doslfnbk seem to able to find it!

>Alternatively, anyone know how it's done?

>----------------------
>John Lee, tel +44 (0)171 446 4357, fax +44 (0)1932 869103
>Space Division, Logica UK Ltd
>l...@logica.com ---opinions are mine---

Ralf Brown knows everything.  Go via pc-urls.htm#Progg at the URL below.
--
John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk  Turnpike v1.12  MIME
  Web URL: http://www.merlyn.demon.co.uk/
  Standard signature separator is as above, a line containing "-- " (SoRFC1036)

Re:accessing long filenames in win95


In article <32F6404F.3...@Logica.com>,
Chris Rankin  <Rank...@Logica.com> wrote:
:services can be found in Ralph Brown's Interrupt List
:(ftp://garbo.uwasa.fi,
:in /pc/programming/inter*.zip - I think...)

 361769 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53a.zip
 inter53a.zip Ralf Brown's listing of interrupt calls, 1/4, impressive

 361969 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53b.zip
 inter53b.zip Ralf Brown's listing of interrupt calls, 2/4, impressive

 362565 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53c.zip
 inter53c.zip Ralf Brown's listing of interrupt calls, 3/4, impressive

 427649 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53d.zip
 inter53d.zip Ralf Brown's listing of interrupt calls, 4/4, impressive

 218367 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53e.zip
 inter53e.zip Utility programs/source code for interrupt list, R.Brown

 217499 Jan 12 1997 ftp://garbo.uwasa.fi/pc/programming/inter53f.zip
 inter53f.zip WinHelp conversion programs for interrupt list, R.Brown

   All the best, Timo

....................................................................
Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa
mailto:t...@uwasa.fi  <URL:http://uwasa.fi/~ts>  ; FIN-65101,  Finland

Re:accessing long filenames in win95


Quote
On Mon, 3 Feb 1997, john lee wrote:
> Anyone have any pascal routines to enable one to access these from dos under
> win95 (eg using bp7). The info is obviously stored on the disk somewhere &
> programs like doslfnbk seem to able to find it!

The best way is to use the "new" DOS 7 function calls [Int 21h] to which
are designed to let you do just that.  I would suggest that before you
even attempt to use them that you check that the DOS version is 7 or later
(as I expect there to be later versions!).  However to be able to use
these new calls means you would then have to write your own replacement
FINDFIRST/FINDNEXT/BLOCKREAD/OPEN/ASSIGN etc functions which use
these NEW calls.  Before you do, I would have a look around the net as
chances are someone probably has already written a TPU for TP7.

If not, the best FREE source of information on these calls is Ralph Browns
interrupt list, I'm afraid I can't remember the files locations on the web
off the top of my head!  I sure someone will be able to reply with it's
location!  Try looking at an early message as a lot of people refer to it!

Ok, a little bit more detail  :-)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Long filename support is actually implemented by the operating system [DOS
7] not by the operating EVIRONMENT GUI, Windows 4 (it's proper internal
name!).  If you wanted to read the disks under other versions of DOS then
you would have to go down to sector level, BOOTSECTOR, File Allocation
Table [FAT], Directory entries etc.  Which is getting quite low level:

E.g from what I can remember the LAST ACCESSED date/time for example is
stored in 4 bytes [longint] in a directory entry which are marked as
reserved in earlier versions of DOS [I had to figure this out using debug
with a BETA version of Windows 95 a long time ago before the books all
came out :-)].

BTW: If you think about it, because of the way long filenames are stored
it means that it would be possible for someone to actually write a TSR
to provide long file name support under early versions of DOS [say ver3.3
and above].  You would need to write a replacent DIR command though!

Linux I believe has Windows 95 long filename support.

My own advice
=-=-=-=-=-=-=
Personally I woul stick to using 8.3 filenames unless you REALLY need to
use long filenames, as the way long filenames are acutally implemented is
a BIG con which involves lots of weird hacks to disk allocations
tables.....  Which is why you get the filena~1 etc, effectively a new
"special hidden" filename entry is created, the longer the filename the
more special entries it has to create.  Still don't have the time to try
to explain that here :)  Don't forget that as earlier versions of DOS
don't recognise these long filenames you will only see the TRUE 8.3
filename under early versions of DOS.

Regards

Richard/Arjay

P.S  Can't fully remember as I have been using Windows 95 for well over a
     year, but there are some undocumented DIR parameters /M /Z
     which display or correctly display extra information under DOS 7.
     [I have the info I wrote in early part of summer 95 somewhere... :-)]

  /----------------------------------------------------------------------\
  |  Richard James (aka Arjay) - SYSOP/P.R for the Aurora PC Demo Group  |
  |          Tel: +44 (01202) 849926    BBS: +44 (01202) 848926          |
  |                                                                      |
  | Meeeow ! Call Spuddy on (01268) 515441 for FREE mail & Usenet access |
  \----------------------------------------------------------------------/

Re:accessing long filenames in win95


Richard James allegedly said:

RJ> The best way is to use the "new" DOS 7 function calls [Int 21h] to which
RJ> are designed to let you do just that.  I would suggest that before you
RJ> even attempt to use them that you check that the DOS version is 7 or later
RJ> (as I expect there to be later versions!).  However to be able to use
RJ> these new calls means you would then have to write your own replacement
RJ> FINDFIRST/FINDNEXT/BLOCKREAD/OPEN/ASSIGN etc functions which use
RJ> these NEW calls.  Before you do, I would have a look around the net as
RJ> chances are someone probably has already written a TPU for TP7.

This is not sufficient, as more than one DOS 7.0 exists. You must:

Use the Int 21h "DOS Version" function (AH=30h, AL=00h to get OEM number).

AH will contain the major version number, AL will contain the minor revision
number. BL will contain the OEM number. Here's the table of vendors (from Ralf
Brown's Interrupt List R53):

(Table 0741)
Values for DOS OEM number:
00h    IBM
01h    Compaq
02h    MS Packaged Product
04h    AT&T
05h    ZDS (Zenith Electronics)
06h    Hewlett-Packard
07h    ZDS (Groupe Bull)
0Dh    Packard-Bell
16h    DEC
23h    Olivetti
28h    Texas Instruments
29h    Toshiba
33h    Novell (Windows/386 device IDs only)
34h    MS Multimedia Systems (Windows/386 device IDs only)
35h    MS Multimedia Systems (Windows/386 device IDs only)
4Dh    Hewlett-Packard
5Eh    RxDOS
66h    PhysTechSoft (PTS-DOS)
99h    General Software's Embedded DOS
EEh    DR DOS
EFh    Novell DOS
FDh    FreeDOS
FFh    Microsoft, Phoenix

Here's the TP7 source to get the OEM number:

FUNCTION WhichDOS: Byte;               { Using long way for protect mode     }

VAR
    Regs: Registers;

BEGIN
    Regs.AX := $3000;
    MsDos(Regs);
    WhichDOS := Regs.BH;
END;

Hope this helps.

--
| Jeff Teunissen, President of Dusk To Dawn Computing.      Team OS/2
| Disclaimer: I am my employer, so anything I say goes double for me.
| Mail to: <a href="mailto:d...@grfn.org">je...@grfn.org</a>

Other Threads