I have some simple code attempting to get the last modified date of the users recycle bin. This code seems to work on other files however it does not work on the recycle bin. I've done some looking into and it seems the recycle bin is a special file as in it's not a regular file. This would explain why I'm getting Unix epoch as the result. Here is my code:
struct tm* tmDateModified;
struct stat attribute;
stat("C:\\$Recycle.Bin\\Recycle Bin", &attribute);
tmDateModified = gmtime(&(attribute.st_mtime));
std::string date = asctime(tmDateModified);
String^ date2 = marshal_as<String^>(date);
MessageBox::Show(date2);
When I execute this code, the MessageBox displays Thu Jan 1 00:00:00 1970 as the result, again that's Unix epoch. I know this is possible as I've seen it done before in other applications, however, I don't have access to their source so I can't exactly figure out how they did it. If anyone knows why Unix epoch is being displayed rather than the actual date modified and how to fix it, I'll take any help.