🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.programmer
4 messages
4 total messages Started by Paul Heffner Mon, 09 Nov 1992 19:48
Stat-ing a Directory file
#614
Author: Paul Heffner
Date: Mon, 09 Nov 1992 19:48
16 lines
1222 bytes
Anyone out there know a way of obtaining the size and time/date
information of a MS-DOS directory file using standard DOS calls
under MASM? For a regular file, you can use Int 21, function 5700
to get the time and date of an open file using its handle, likewise
you can use the old seek-to-end trick to get the file size, but both 
of these require an open file handle to work, and you can't open a
directory file like in Unix (or can you?). The MS C stat function
goes as far as returning what seems to be a good set of timestamp
information, so I guess it's there for using if you know how to get
it. (Or does that function resort to sneaky non-standard methods
to get the info?) All input would be appreciated!

Thanks!

Heff
Re: Stat-ing a Directory file
#618
Author: Carl Harris
Date: Tue, 10 Nov 1992 22:49
28 lines
1674 bytes
pheffner@fang.att.com (Paul Heffner) writes:
: 
: Anyone out there know a way of obtaining the size and time/date
: information of a MS-DOS directory file using standard DOS calls
: under MASM? For a regular file, you can use Int 21, function 5700
: to get the time and date of an open file using its handle, likewise
: you can use the old seek-to-end trick to get the file size, but both 
: of these require an open file handle to work, and you can't open a
: directory file like in Unix (or can you?). The MS C stat function
: goes as far as returning what seems to be a good set of timestamp
: information, so I guess it's there for using if you know how to get
: it. (Or does that function resort to sneaky non-standard methods
: to get the info?) All input would be appreciated!
: 
: Thanks!
: 
: Heff


You can open a directory just like any other file, and read the time
and date stamp of any file there in.  The format is the same as that used
in the root directory.

-- 
+---------------+---------------------------------------------------+
| Carl Harris   |program (tv).  To engage in an activity similar to |
| CS @ VA TECH  |banging one's head against a wall, but with fewer  |
|               |opportunities for reward.                          |
Re: Stat-ing a Directory file
#620
Author: Russell J Mellon
Date: Wed, 11 Nov 1992 03:45
53 lines
2497 bytes
In article <BxGsCA.Lnu@fang.att.com> pheffner@fang.att.com (Paul Heffner) writes:
>
>Anyone out there know a way of obtaining the size and time/date
>information of a MS-DOS directory file using standard DOS calls
>under MASM? For a regular file, you can use Int 21, function 5700
>to get the time and date of an open file using its handle, likewise
>you can use the old seek-to-end trick to get the file size, but both 
>of these require an open file handle to work, and you can't open a
>directory file like in Unix (or can you?). The MS C stat function
>goes as far as returning what seems to be a good set of timestamp
>information, so I guess it's there for using if you know how to get
>it. (Or does that function resort to sneaky non-standard methods
>to get the info?) All input would be appreciated!
>
>Thanks!
>
>Heff

Supprised that you know about the Int 21h function 5700 and don't know about
the Int 21h function 11h and function 12h.  Function 11h Finds the first file
matching the file specifications, and function 12h finds the next.

for both, DX = offset of a File Control Block ( you fill in the info )
          DS = segment for the same FCB

These are for DOS Ver 1.0 or better.  for DOS ver 2.0 and better there are
functions 4Eh and 4Fh.

for 4Eh ( find first ):
   ah = 4eh
   cx = file attributes to search for
       0 - Read-Only
       1 - Hidden
       2 - System
       3 - Volume label
       4 - Reserved ( should be 0 )
       5 - Archive
       and bits 6 through 15 are reserved also
   dx = Offset of ASCII string specifing filename ( and optionally a path )
   ds = Segment of above string.  string must be terminated with a nul byte

for 4Fh ( find next )
   ax = 4Fh


before using 4Eh, call service 1Ah to set the address of the current DTA
   ah = 1Ah
   dx = offset
   ds = segment

the DTA is 128 bytes long and is used by service 4Eh and 4Fh.

Hope I helped. 
Re: Stat-ing a Directory file
#625
Author: DAVID SCOTT PASCHAL
Date: Wed, 11 Nov 1992 16:31
11 lines
1162 bytes
In article <BxIvF5.Ao6@csugrad.cs.vt.edu>, ceharris@csugrad.cs.vt.edu (Carl Harris) writes:
|>You can open a directory just like any other file, and read the time
|>and date stamp of any file there in.  The format is the same as that used
|>in the root directory.

But this only works with FCB-type calls (using extended FCBs).  Handle-based
calls will not open subdirectories or volume labels.

Tschuess,
David Paschal
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads