mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user