Deleting a file that isn't there = "success", aside from the exception.

Description

If I try to delete a file that isn’t there, I get an exception. This happens for file systems and cfftp. The reality is that my intent was to make the file ‘not there'. If it isn’t, whether that was caused by my explicit removal, or it wasn’t there to begin with, the goal of creating the delete code is accomplished. Rather than making me check if the file exists before deleting, or wrapping every delete with a try/catch, can we assume that the goal has been met and we can all move along?

Activity

John Wilson 8 April 2022 at 14:52
Edited

I would also add that if you want desperately to do something if the file doesn't exist, you could still create an if-exists wrapper.

Details

Assignee

Reporter

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 22 March 2022 at 16:45
Updated 1 June 2022 at 06:15