mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
59 lines
1.3 KiB
Diff
59 lines
1.3 KiB
Diff
--- a/diskfile.cpp
|
|
+++ b/diskfile.cpp
|
|
@@ -340,7 +340,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
|
|
return matches;
|
|
}
|
|
|
|
-
|
|
+u64 DiskFile::GetFileSize(string filename)
|
|
+{
|
|
+ struct _stati64 st;
|
|
+ if ((0 == _stati64(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
+ {
|
|
+ return st.st_size;
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ return 0;
|
|
+ }
|
|
+}
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -689,6 +700,18 @@ list<string>* DiskFile::FindFiles(string path, string wildcard)
|
|
return matches;
|
|
}
|
|
|
|
+u64 DiskFile::GetFileSize(string filename)
|
|
+{
|
|
+ struct stat st;
|
|
+ if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
+ {
|
|
+ return st.st_size;
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ return 0;
|
|
+ }
|
|
+}
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
#endif
|
|
|
|
@@ -802,18 +825,6 @@ bool DiskFile::FileExists(string filename)
|
|
return ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)));
|
|
}
|
|
|
|
-u64 DiskFile::GetFileSize(string filename)
|
|
-{
|
|
- struct stat st;
|
|
- if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG)))
|
|
- {
|
|
- return st.st_size;
|
|
- }
|
|
- else
|
|
- {
|
|
- return 0;
|
|
- }
|
|
-}
|
|
|
|
|