514.1589, stable as time of writing.
As title explains, calling client.Export() will not delete, not even empty the file at least.
Numbered Steps to Reproduce Problem:
1. Export a savefile with some data on it.
2. Import it to see that everything's fine.
3. Call client.Export().
4. Import it and see that nothing has changed, the savefile still contains data/exists.
Code Snippet (if applicable) to Reproduce Problem:
/world/hub = "Exadv1.spacestation13"
/client/verb/get_savefile()
set name = "get savefile"
var/savefile/S = new(Import())
var/txtfile = file("test.txt")
fdel(txtfile)
S.ExportText(S, txtfile)
/client/verb/empty_savefile()
set name = "empty savefile"
Export()
/client/verb/create_savefile()
set name = "create savefile"
var/savefile/S = new()
S["deleted"] << 1
Export(S)
Expected Results:
A file deletion.
Actual Results:
Nothing changes.
Does the problem occur:
Every time? Or how often?
Every time.
In other games?
Quite possibly? The example contains a snippet that will show that it fails even at an empty environment.
In other user accounts?
Probably, untested.
On other computers?
Untested.
When does the problem NOT occur?
There is no situation where the problem does not occur, at most you can clear the file by using the (create_savefile()) on the example.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
I am not aware whether this proc has worked the correct way before.
Workarounds:
Perform as the example (create_savefile()) does, it will not delete the file, but at least it will clear it for you.