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
Post a Comment