Skip to content

Commit

Permalink
Clarify logic for testing writeability with faketestfile_69.replay (#…
Browse files Browse the repository at this point in the history
…1217)

* Update replay-stocks.sp

* Update replay-stocks.sp

XDDD

* Update replay-stocks.sp

ecksdee.

* Update replay-stocks.sp

f.. you

* Update replay-stocks.sp

hucvfrsdtbh
  • Loading branch information
Nairdaa authored Sep 23, 2024
1 parent fee7df2 commit 1b67644
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions addons/sourcemod/scripting/include/shavit/replay-stocks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,18 @@ stock void Shavit_Replay_CreateDirectories(const char[] sReplayFolder, int style
}
}

// Test to see if replay file creation even works...
// Test to see if replay file creation works
FormatEx(sPath, sizeof(sPath), "%s/0/faketestfile_69.replay", sReplayFolder);
File fTest = OpenFile(sPath, "wb+");
CloseHandle(fTest);

// Check if the file was opened successfully for writing
if (fTest == null)
{
SetFailState("Failed to write to replay folder (%s). Make sure you have file permissions.", sReplayFolder);
}
else
{
// File was opened successfully, now close it
CloseHandle(fTest);
}
}

0 comments on commit 1b67644

Please sign in to comment.