I´m writing a networking application, that serves as an updater : Basically it checks the files on the server and the client, if client does not have some files it downloads them, or, if the modification time of files on server differs from the clients then they are also downloaded. (I know its very simple and maybe not best way, but its for experiments).
However, not sure if my way to get the last modification time (converted into string) is portable, because even the standard documentation mentions some compilers might have different behaviour.
static std::string lastWriteTime(const std::string& itemName)
{
std::experimental::filesystem::path file(itemName);
auto time = std::experimental::filesystem::last_write_time(file);
std::time_t cftime = decltype(time)::clock::to_time_t(time);
return std::to_string(cftime);
}
Now my question: will the output differ, if i put it on Linux server? (now i host only on windows). So basically if i use windows server, the output will be 10. But if I host it on Linux, output will be different? Because then the windows users will have to redownload everything all the time (because of different modification times).
Aucun commentaire:
Enregistrer un commentaire