Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File5.21.16 DTA TOS This structure is defined as follows: typedef struct { int8_t d_reserved[21]; /* Reserved for GEMDOS */ uint8_t d_attrib; /* File attributes */ uint16_t d_time; /* Time */ uint16_t d_date; /* Date */ uint32_t d_length; /* File length */ int8_t d_fname[14]; /* Filename */ } DTA; Recursive search in folders In each DTA, all required information is stored that is required after a Fsfirst for further Fsnext calls. That means that one should never call Fsfirst anew for other directories/wildcards as long as further Fsnext calls are made in the same directory.(!nl) For a recursive search one must use a new DTA for each new Fsfirst, which must be maintained until all Fsnext for the Fsfirst have been made. Here an example in pseudo-C: void search_directory (int8_t *pfadname) { DTA_Record local_dta, saved_dta; saved_dta = GetDTA (); SetDTA (local_dta); err = Fsfirst (pfadname, ...); while (err == 0) { if (local_dta.attrib == subdir) { // recursive search in sub-dir search_directory (subdir-pfadname); } else { ... evaluate normal file } err = Fsnext (); } SetDTA (saved_dta); } See also: Fgetdta Fsetdta Fsfirst Fsnext GEMDOS