RosettaCodeData/Task/Delete-a-file/FutureBasic/delete-a-file.basic

20 lines
522 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
include "NSLog.incl"
CFURLRef url
url = fn URLFileURLWithPath( fn StringByExpandingTildeInPath( @"~/Desktop/input.txt" ) )
if (fn FileManagerRemoveItemAtURL( url ) )
NSLog( @"File \"intput.txt\" deleted." )
else
NSLog( @"Unable to delete file \"input.txt\"." )
end if
url = fn URLFileURLWithPath( fn StringByExpandingTildeInPath( @"~/Desktop/docs" ) )
if (fn FileManagerRemoveItemAtURL( url ) )
NSLog( @"Directory \"docs\" deleted." )
else
NSLog( @"Unabled to delete directory \"docs\"." )
end if
HandleEvents