updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / par2cmdline / 01-Use-_stati64-under-WIN32-to-get-file-size.patch
blob65e5d61cc021b6646360fbbf5193ec152e1cb30a
1 --- a/diskfile.cpp
2 +++ b/diskfile.cpp
3 @@ -340,7 +340,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
4 return matches;
8 +u64 DiskFile::GetFileSize(string filename)
9 +{
10 + struct _stati64 st;
11 + if ((0 == _stati64(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
12 + {
13 + return st.st_size;
14 + }
15 + else
16 + {
17 + return 0;
18 + }
22 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
23 @@ -689,6 +700,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
24 return matches;
27 +u64 DiskFile::GetFileSize(string filename)
29 + struct stat st;
30 + if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
31 + {
32 + return st.st_size;
33 + }
34 + else
35 + {
36 + return 0;
37 + }
39 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
40 #endif
42 @@ -802,18 +825,6 @@ bool DiskFile::FileExists(string filename)
43 return ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)));
46 -u64 DiskFile::GetFileSize(string filename)
48 - struct stat st;
49 - if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
50 - {
51 - return st.st_size;
52 - }
53 - else
54 - {
55 - return 0;
56 - }