Use fs::file_size instead of stat

This commit is contained in:
Luis Díaz Más 2022-02-18 22:05:44 +01:00
parent 7e5ba7cb23
commit 7caf4090b1

View File

@ -278,11 +278,8 @@ namespace Action {
std::cout << path_ << std::endl;
// Filesize
struct stat buf;
if (0 == stat(path_.c_str(), &buf)) {
printLabel(_("File size"));
std::cout << buf.st_size << " " << _("Bytes") << std::endl;
}
printLabel(_("File size"));
std::cout << fs::file_size(path_) << " " << _("Bytes") << std::endl;
// MIME type
printLabel(_("MIME type"));