updating the HLE FS and FileIO

added banner support of the savegames for wii... same games 

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1031 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc
2008-11-01 15:59:06 +00:00
parent dad9f74b09
commit 046ca53f8c
9 changed files with 391 additions and 102 deletions

View File

@ -48,6 +48,10 @@ bool Exists(const char *filename)
bool IsDirectory(const char *filename)
{
#ifdef _WIN32
DWORD Attribs = GetFileAttributes(filename);
if (Attribs == INVALID_FILE_ATTRIBUTES)
return false;
return (GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY) != 0;
#else
struct stat file_info;
@ -163,11 +167,15 @@ std::string GetUserDirectory()
u64 GetSize(const char *filename)
{
FILE *f = fopen(filename, "rb");
fseek(f, 0, SEEK_END);
u64 pos = ftell(f);
fclose(f);
return pos;
FILE *pFile = fopen(filename, "rb");
if (pFile)
{
fseek(pFile, 0, SEEK_END);
u64 pos = ftell(pFile);
fclose(pFile);
return pos;
}
return 0;
}
#ifdef _WIN32
@ -236,4 +244,14 @@ u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry)
}
#endif
bool CreateEmptyFile(const char *filename)
{
FILE* pFile = fopen(filename, "wb");
if (pFile == NULL)
return false;
fclose(pFile);
return true;
}
} // namespace