Atari ST series Technical Reference Manual page 294

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

Find First File in Directory Chain
Fsfirst()
T h is f u n c t i o n is u s e d to f in d t h e f ir s t file in a d i r e c t o r y t h a t m a t c h e s a p a r ­
t i c u l a r d e s c r i p t i o n . I t is u s e d in o b t a i n i n g a d i r e c t o r y lis tin g .
C macro format
i n t s t a t u s , a tt r i b u t e s ;
c h a r * f i le s p e c ;
s t a t u s =
F s f i r s t ( f i l e s p e c , a t t r i b s ) ;
Machine language format
m o v e . w
a t t r i b s , - ( s p )
m o v e . l
f ile s p e c , - (s p )
m o v e . w
# $ 4 E , - ( s p )
t r a p
# 1
a d d q .l
# 8 , s p
Inputs
a t t r i b s
w o r d
I n t e r p r e t a t i o n o f v a l u e in
Bit Number
Attribute
0
R e a d - o n l y file ( c a n 't b e d e l e t e d o r w r i t t e n to )
1
H i d d e n file ( e x c l u d e d f r o m n o r m a l d i r e c t o r y s e a r c h e s )
2
S y s t e m file ( e x c l u d e d f r o m n o r m a l d i r e c t o r y s e a r c h e s )
3
V o l u m e la b e l ( c a n o n l y e x i s t in r o o t )
4
S u b d i r e c t o r y
5
A r c h i v e b it
f i l e s p e c
l o n g
Results
DO
s t a t u s
w o r d
a n d a 4 4 - b y t e d a t a s t r u c t u r e is w r i t t e n t o t h e a d d r e s s p o i n t e d to b y t h e
D T A . If a m a t c h i s n 't f o u n d , t h e a p p r o p r i a t e n e g a t i v e G E M D O S e r r o r
n u m b e r is r e t u r n e d .
I n f o r m a t i o n in d a t a s t r u c t u r e r e t u r n e d if m a t c h is s u c c e s s f u l :
Byte Number
Contents
0 - 2 0
R e s e r v e d f o r i n t e r n a l u s e ( m u s t n o t b e a l t e r e d )
2 1
F ile a t t r i b u t e s
2 2 - 2 3
T i m e s t a m p
2 4 - 2 5
D a t e s t a m p
2 6 - 2 9
F ile s iz e
3 0 - 4 3
F i l e n a m e a n d e x t e n s i o n
See also
Fsnext()
Fsfirst
T h e a t t r i b u t e s o f th e file t o s e a r c h f o r .
attribs:
P o i n t e r to a n u l l - t e r m i n a t e d A S C I I s t r i n g
c o n t a i n i n g t h e file s p e c if ic a tio n to b e
s e a r c h e d f o r . If w i l d c a r d s a r e u s e d , it
m a y m a t c h m o r e t h a n o n e file .
If a m a t c h is f o u n d , a v a l u e o f 0 is r e t u r n e d h e r e ,
Opcode = 78 ($4E)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents