Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2014 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6c7c4340e2a656b2066b to your computer and use it in GitHub Desktop.
Save anonymous/6c7c4340e2a656b2066b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <tos.h>
void main(void)
{
char name[20], line[200];
int i, fd, err, err2, log;
log = Fcreate("L:\\atari.log", 0);
Dcreate("L:\\TEST");
for (i=32; i<256; i++) {
sprintf(name, "L:\\TEST\\%02X_%c.TXT", i, i);
fd=Fcreate(name, 0);
err=fd<0;
if (!err)
err=Fclose(fd);
sprintf(line, "%02X - '%s' - %s\n", i, name, err?"error":"created");
printf(line);
if (Fwrite(log, strlen(line), line)!=strlen(line))
printf("Can't write to logfile");
}
printf("Press Enter to start deletion of the files\n");
Cconin();
for (i=32; i<256; i++) {
sprintf(name, "L:\\TEST\\%02X_%c.TXT", i, i);
err=Fsfirst(name, 0);
err2=Fdelete(name);
sprintf(line, "%02X - '%s' - %s, %s\n", i, name,
err ? "not found" : "found",
err2 ? "error" : "deleted");
printf(line);
if (Fwrite(log, strlen(line), line)!=strlen(line))
printf("Can't write to logfile");
}
Fclose(log);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment