のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

Log: Couldn't rename file, to backup file

    544     private void writeToFile(MemoryCommitResult mcr) {
    545         // Rename the current file so it may be used as a backup during the next read
    546         if (mFile.exists()) {
    547             if (!mcr.changesMade) {
    548                 // If the file already exists, but no changes were
    549                 // made to the underlying map, it's wasteful to
    550                 // re-write the file.  Return as if we wrote it
    551                 // out.
    552                 mcr.setDiskWriteResult(true);
    553                 return;
    554             }
    555             if (!mBackupFile.exists()) {
            バックアップファイルがないとき通る
    556                 if (!mFile.renameTo(mBackupFile)) {
              リネームが失敗したとき通る
    557                     Log.e(TAG, "Couldn't rename file " + mFile
    558                           + " to backup file " + mBackupFile);
    559                     mcr.setDiskWriteResult(false);
    560                     return;
    561                 }
    562             } else {
    563                 mFile.delete();
    564             }
    565         }