Test writable without writing a file. This reduces the chance of corruption: merely mounting a device should not write to it.

This commit is contained in:
Glenn Maynard
2005-12-06 21:53:47 +00:00
parent 4bd7da7256
commit a4c0b8e963
@@ -40,15 +40,7 @@ bool VectorsAreEqual( const T &a, const T &b )
static bool TestWrite( CCStringRef sDir )
{
// Try to write a file.
// TODO: Can we use RageFile for this?
CString sFile = sDir + "/temp";
FILE* fp = fopen( sFile, "w" );
if( fp == NULL )
return false;
fclose( fp );
remove( sFile );
return true;
return access(sDir, W_OK) == 0;
}
static bool ExecuteCommand( CCStringRef sCommand )