C++ Should I check whether a file exists before deleting it? -


quite simply, want delete file may or may not exist. bad practice use remove(filename) , ignore return value?

edit: remove, i'm referring this

should check whether file exists before deleting it?

there no such requirement or need, , doing in no way useful.

and ignore return value?

usually, user may want know whether file deleted or not, bad idea ignore return value. further, user wants know why file not deleted (see std::perror).


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -