remove RageFileDriver::Ready
This commit is contained in:
@@ -19,7 +19,6 @@ public:
|
||||
virtual int GetFileSizeInBytes( const CString &sFilePath );
|
||||
virtual int GetFileHash( const CString &sPath );
|
||||
virtual int GetPathValue( const CString &path );
|
||||
virtual bool Ready() { return true; } /* see RageFileManager::MountpointIsReady */
|
||||
virtual void FlushDirCache( const CString &sPath );
|
||||
virtual bool Remove( const CString &sPath ) { return false; }
|
||||
|
||||
|
||||
@@ -167,11 +167,6 @@ RageFileBasic *RageFileObjDirect::Copy() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool RageFileDriverDirect::Ready()
|
||||
{
|
||||
return PathReady( root );
|
||||
}
|
||||
|
||||
bool RageFileDriverDirect::Remount( const CString &sPath )
|
||||
{
|
||||
root = sPath;
|
||||
|
||||
@@ -12,7 +12,6 @@ public:
|
||||
|
||||
RageFileBasic *Open( const CString &path, int mode, int &err );
|
||||
bool Remove( const CString &sPath );
|
||||
bool Ready();
|
||||
bool Remount( const CString &sPath );
|
||||
|
||||
private:
|
||||
|
||||
@@ -116,52 +116,6 @@ bool WinMoveFile( CString sOldPath, CString sNewPath )
|
||||
}
|
||||
#endif
|
||||
|
||||
bool PathReady( CString path )
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
// Windows will throw up a message box if we try to write to a
|
||||
// removable drive with no disk inserted. Find out whether there's a
|
||||
// disk in the drive w/o writing a file.
|
||||
|
||||
// find drive letter
|
||||
vector<CString> matches;
|
||||
static Regex parse("^([A-Za-z]+):");
|
||||
parse.Compare( path, matches );
|
||||
if( matches.size() != 1 )
|
||||
return false;
|
||||
|
||||
CString sDrive = matches[0];
|
||||
TCHAR szVolumeNameBuffer[MAX_PATH];
|
||||
DWORD dwVolumeSerialNumber;
|
||||
DWORD dwMaximumComponentLength;
|
||||
DWORD lpFileSystemFlags;
|
||||
TCHAR szFileSystemNameBuffer[MAX_PATH];
|
||||
BOOL bResult = GetVolumeInformation(
|
||||
sDrive + ":\\",
|
||||
szVolumeNameBuffer,
|
||||
sizeof(szVolumeNameBuffer),
|
||||
&dwVolumeSerialNumber,
|
||||
&dwMaximumComponentLength,
|
||||
&lpFileSystemFlags,
|
||||
szFileSystemNameBuffer,
|
||||
sizeof(szFileSystemNameBuffer) );
|
||||
return !!bResult;
|
||||
#else
|
||||
// Try to create directory before writing a temp file.
|
||||
CreateDirectories( path );
|
||||
|
||||
// Try to write a file.
|
||||
const CString sFile = path + "temp";
|
||||
int fd = DoOpen( sFile, O_WRONLY|O_CREAT|O_TRUNC, 0644 );
|
||||
if( fd == -1 )
|
||||
return false;
|
||||
|
||||
close( fd );
|
||||
remove( sFile );
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* mkdir -p. Doesn't fail if Path already exists and is a directory. */
|
||||
bool CreateDirectories( CString Path )
|
||||
{
|
||||
|
||||
@@ -30,7 +30,6 @@ bool WinMoveFile( CString sOldPath, CString sNewPath );
|
||||
#endif
|
||||
|
||||
bool CreateDirectories( CString sPath );
|
||||
bool PathReady( CString sPath );
|
||||
|
||||
#include "RageUtil_FileDB.h"
|
||||
class DirectFilenameDB: public FilenameDB
|
||||
|
||||
Reference in New Issue
Block a user