Atari ST series Technical Reference Manual page 132

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

The Ddelete() function is used to remove a subdirectory:
int status;
char ^pathname;
status = Ddelete(pathname);
where pathname points to a null-terminated ASCII string
which contains the path name of the directory to delete. If
GEMDOS is able to delete the directory, a 0 is returned in
status, otherwise, a negative GEMDOS error number is re­
turned. Note that a subdirectory may only be deleted if it is
empty.
Program 6-2 below demonstrates the entire process for
obtaining a directory listing in C.
Program 6-2. GDIR.C
/**********************************************/
/*
/*
GDIR.C— Demonstrates how to get a
/*
directory listing using GEMDOS
/*
file functions.
/*
/**********************************************/
#include <osbind.h>
struct diskbufr
(
2 1
char resvd[
];
char attr;
int
ftime;
int
fdate;
long fsize;
char fname[14];
} d t a ;
char blank[13]="
main(argc,argv)
int argc;
char *argv[];
{
struct diskbufr *olddta;
char *temp;
2
if (argc>
)
{
Cconws("Too many arguments\r\n");
exit(O);
}
2
if (argc==
)
1
temp=argv[
else temp = "*.*"?
olddta = (struct diskbufr *)Fgetdta(); /* save old DTA */
Fsetdta (&dta);
if (Fsfirstftemp,0x10))
puts ("File(s) not found");
else
(
print_entry();
whilef!Fsnext())
print_entry();
124
CHAPTER 6
/* For GEMDOS macro definitions */
/* data structure for DTA
/* 12 spaces— for name padding */
/* number of command arguments */
/* array of pointers to command strings */
/* if more than one command argument */
/ *
complain and quit */
/ *
];
if only one argument, use it */
/* or default to
*/
* /
*/
*/
*/
* /
* /
/* and use new DTA */
/* get first file
/* and print entries.. */
/* until done */
* /

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents