Fsfirst
Find First File in Directory Chain
Fsfirst() Opcode = 78 ($4E)
T h is fu n ctio n is u se d to find th e first file in a d irec to ry th at m a tch es a p ar
ticu lar d esc rip tio n . It is u sed in ob tain in g a d irec to ry listing.
C macro format
in t sta tu s, a ttrib u tes;
c h a r *filesp ec;
statu s = F sfirst(filesp ec, attrib s);
Machine language format
m o v e .w a ttrib s, - (sp )
m o v e.l filesp ec, - (sp )
m o v e .w # $ 4 E , - (sp )
tra p # 1
ad d q .l # 8 ,s p
Inputs
attrib s w o rd T h e attrib u te s of th e file to sea rch for.
In terp re ta tio n o f v alu e in attribs:
Bit Number Attribute
0 R e ad -o n ly file (c a n 't b e d eleted o r w ritten to )
1 H id d en file (e xclu d ed from n orm a l d irecto ry sea rch es )
2 S ystem file (e xclu d ed fro m n o rm al d ire cto ry se arch es)
3 V o lu m e label (ca n o n ly ex ist in ro ot)
4 S u b d irecto ry
5 A rch iv e bit
filesp ec lo n g P o in te r to a n u ll-te rm in ate d A S CII strin g
co n ta in in g th e file sp ecificatio n to b e
se arch ed for. If w ild card s are u se d , it
m ay m a tch m o re th an o n e file.
Results
DO sta tu s w o rd If a m atch is fou n d, a v a lu e of 0 is re tu rn ed h er e ,
a n d a 4 4 -b yte d ata stru ctu re is w ritte n to th e ad d re ss p oin ted to by th e
D T A . If a m atc h is n 't fou n d, th e ap p ro p riate n eg ativ e G E M D O S e rro r
n u m b er is retu rn ed .
In fo rm ation in d ata s tru ctu re retu rn ed if m atc h is su ccessfu l:
Byte Number Contents
0 - 2 0 R ese rv ed for in tern al u se (m u st n o t b e alte re d )
21 File attrib u tes
2 2 - 2 3 T im e sta m p
2 4 - 2 5 D a te sta m p
2 6 -2 9 File size
3 0 - 4 3 F ilen am e an d ex ten sio n
See also
Fsnext()