Task

Delete a file called "input.txt" and delete a directory called "docs".

This should be done twice: once "here", i.e. in the current working directory and once in the filesystem root.




PROC Dir(CHAR ARRAY filter)
  CHAR ARRAY line(255)
  BYTE dev=[1]
 
  Close(dev)
  Open(dev,filter,6)
  DO
    InputSD(dev,line)
    PrintE(line)
    IF line(0)=0 THEN
      EXIT
    FI
  OD
  Close(dev)
RETURN
 
PROC DeleteFile(CHAR ARRAY fname)
  BYTE dev=[1]
 
  Close(dev)
  Xio(dev,0,33,0,0,fname)
RETURN
 
PROC Main()
  CHAR ARRAY filter="D:*.*", fname="D:INPUT.TXT"
 
  PrintF("Dir ""%S""%E",filter)
  Dir(filter)
 
  PrintF("Delete file ""%S""%E%E",fname)
  DeleteFile(fname)
 
  PrintF("Dir ""%S""%E",filter)
  Dir(filter)
RETURN