make remount work
This commit is contained in:
@@ -176,6 +176,7 @@ bool RageFileDriverDirect::Remount( const CString &sPath )
|
||||
root = sPath;
|
||||
if( root.Right(1) != "/" )
|
||||
root += '/';
|
||||
((DirectFilenameDB *) FDB)->SetRoot( sPath );
|
||||
|
||||
/* If the root path doesn't exist, create it. */
|
||||
CreateDirectories( root );
|
||||
|
||||
@@ -226,6 +226,12 @@ bool CreateDirectories( CString Path )
|
||||
DirectFilenameDB::DirectFilenameDB( CString root_ )
|
||||
{
|
||||
ExpireSeconds = 30;
|
||||
SetRoot( root_ );
|
||||
}
|
||||
|
||||
|
||||
void DirectFilenameDB::SetRoot( CString root_ )
|
||||
{
|
||||
root = root_;
|
||||
if( root.Right(1) != "/" )
|
||||
root += '/';
|
||||
|
||||
@@ -35,12 +35,13 @@ bool PathReady( CString path );
|
||||
#include "RageUtil_FileDB.h"
|
||||
class DirectFilenameDB: public FilenameDB
|
||||
{
|
||||
public:
|
||||
DirectFilenameDB( CString root );
|
||||
void SetRoot( CString root );
|
||||
|
||||
protected:
|
||||
virtual void PopulateFileSet( FileSet &fs, const CString &sPath );
|
||||
CString root;
|
||||
|
||||
public:
|
||||
DirectFilenameDB( CString root_ );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -503,13 +503,15 @@ void RageFileManager::Remount( CString sMountpoint, CString sPath )
|
||||
RageFileDriver *pDriver = FILEMAN->GetFileDriver( sMountpoint );
|
||||
if( pDriver == NULL )
|
||||
{
|
||||
LOG->Warn( "Remount(%s,%s): mountpoint not found",
|
||||
sMountpoint.c_str(), sPath.c_str() );
|
||||
if( LOG )
|
||||
LOG->Warn( "Remount(%s,%s): mountpoint not found", sMountpoint.c_str(), sPath.c_str() );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !pDriver->Remount(sPath) )
|
||||
LOG->Warn( "Remount(%s,%s): remount failed (does the driver support remounting?)" );
|
||||
else
|
||||
pDriver->FlushDirCache( "" );
|
||||
|
||||
FILEMAN->ReleaseFileDriver( pDriver );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user