diff --git a/src/operations.cpp b/src/operations.cpp
index 8809f5c..40a68e8 100644
a
|
b
|
using std::wstring;
|
116 | 116 | # else |
117 | 117 | # include <sys/utime.h> |
118 | 118 | # endif |
| 119 | # include <sys/stat.h> |
119 | 120 | |
120 | 121 | // REPARSE_DATA_BUFFER related definitions are found in ntifs.h, which is part of the |
121 | 122 | // Windows Device Driver Kit. Since that's inconvenient, the definitions are provided |
… |
… |
namespace detail
|
1284 | 1285 | : path_stat.st_size == 0; |
1285 | 1286 | # else |
1286 | 1287 | |
1287 | | WIN32_FILE_ATTRIBUTE_DATA fad; |
1288 | | if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0, |
1289 | | p, ec, "boost::filesystem::is_empty")) |
1290 | | return false; |
1291 | | |
1292 | | if (ec != 0) ec->clear(); |
1293 | | return |
1294 | | (fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) |
1295 | | ? is_empty_directory(p) |
1296 | | : (!fad.nFileSizeHigh && !fad.nFileSizeLow); |
| 1288 | struct _stat path_stat; |
| 1289 | if (error(::_wstat(p.c_str(), &path_stat) != 0, |
| 1290 | p, ec, "boost::filesystem::is_empty")) |
| 1291 | return false; |
| 1292 | return ((path_stat.st_mode & _S_IFDIR) != 0) |
| 1293 | ? is_empty_directory(p) |
| 1294 | : path_stat.st_size == 0; |
1297 | 1295 | # endif |
1298 | 1296 | } |
1299 | 1297 | |