diff options
| author | nakeee <nakeee@gmail.com> | 2008-11-24 17:31:30 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2008-11-24 17:31:30 +0000 |
| commit | 4dd91ec191bddff6158d181a458b3ad450dda957 (patch) | |
| tree | ff9c3a42a63b55266177ac033eb3033569c5b8b0 /Source/Core | |
| parent | 0d714b9971a7b5b8e3e9eca620950b49f4d74272 (diff) | |
fix getsize on 32 bit linux
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1288 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index c00ddc8d6c..73ae338ded 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -191,15 +191,25 @@ std::string GetUserDirectory() u64 GetSize(const char *filename)
{
- FILE *pFile = fopen(filename, "rb");
- if (pFile)
+#ifdef _WIN32
+ FILE *pFile = fopen(filename, "rb");
+ if (pFile)
{
- fseek(pFile, 0, SEEK_END);
- u64 pos = ftell(pFile);
- fclose(pFile);
- return pos;
- }
- return 0;
+ fseek(pFile, 0, SEEK_END);
+ u64 pos = ftell(pFile);
+ fclose(pFile);
+ return pos;
+ }
+#else
+ struct stat buf;
+ if (stat(filename, &buf) == 0) {
+ return buf.st_size;
+ }
+ int err = errno;
+ PanicAlert("Error stating %s: %s", filename, strerror(err));
+
+#endif
+ return 0;
}
#ifdef _WIN32
@@ -263,6 +273,7 @@ u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry) #else
u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry)
{
+ PanicAlert("Scan directory not implemanted yet\n");
// TODO - Insert linux stuff here
return 0;
}
|
