File getLastModificationTime return result

getLastModificationTime() is said to return “the time, or the Unix Epoch if the file doesn’t exist.”

So, would this be correct?

auto answer = myFile.getLastModificationTime();
if (answer == Time{})
{
    fileDoesntExist = true;
}

On Windows, I have found it needs to be:

auto answer = myFile.getLastModificationTime();
if (answer == Time{1000})
{
    fileDoesntExist = true;
}

Sorry, this was my mistake. if (answer == Time{}) works on Windows.
I cannot seem to delete the post. If someone has the power, feel free.

Be careful with your assumptions because there might be the case of a file created with a modification time that equals the Unix Epoch.

In that case, your code would assume that the file does not exist, while in fact it does.
Why don’t you use the .exists() function?

Thanks for the response! The idea was more along the lines of trying to get some sort of useful information to return in a Result. Since, as you say, answer == Time{} is ambiguous, more checks to try to figure out the reason for failure would be wise.