Reputation: 6015
Deletion of a directory created problems if files are in use
(SETUP) 13 % file delete -force -- $env(TMP)
error deleting "../Temp\abcd": permission denied
Is there an option that allows ignoring files/dirs that show deletion violation? I don't mind if some files / dirs are not deleted as long as I am cleaning up bulk of temp files.
Upvotes: 0
Views: 403
Reputation: 5723
You can wrap the file delete
in a catch
statement:
catch { file delete -force -- $env(TMP) }
I hope you never run this as root. Deleting your /tmp directory would be a bad thing.
References: catch
Upvotes: 1