From a4c0b8e9635178d9ca18a5f2b1c8f96a725c5525 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 6 Dec 2005 21:53:47 +0000 Subject: [PATCH] Test writable without writing a file. This reduces the chance of corruption: merely mounting a device should not write to it. --- .../arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index 23226f3fee..63d58d34f7 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -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 )