Delete a file or directory

Added by iNTERFACEWARE

Use os.remove() to delete a file or directory, only an empty directory can be deleted

Source Code
   -- create and delete a file

   -- create a file
   io.open('MyTempFile', 'w')
   os.fs.stat('MyTempFile')
   
   -- remove (delete) the file
   os.remove('MyTempFile')  
   os.fs.stat('MyTempFile') -- stats no longer available
   
   -- create and delete a directory

   -- create a directory
   os.fs.mkdir('MyTempDir')
   os.fs.stat('MyTempDir')
   
   -- remove (delete) the directory
   os.remove('MyTempDir')  
   os.fs.stat('MyTempDir') -- stats no longer available
Description
Use os.remove() to delete a file or directory, only an empty directory can be deleted