Renaming demo files
I've added a builtin (#643 a rename function like rename in stdio.h) but this builtin is not recognized (error: Menu_Error: No such builtin #643 in menu; most likely cause: outdated engine build. Try updating!) Diff is included.
#2 Updated by XonColin about 2 years ago
- File Demo_Rename.diff added
Added the Demo_Rename.diff again. Problem: whenever renaming a demo to an already existing demo name, one demo disappears (i.g., "coolDemo" already exists and you rename "someRandomDemo" to "coolDemo" then one of the "coolDemo" files disappears).
#3 Updated by XonColin about 2 years ago
I've added a "boolean" giving the option to overwrite or not to overwrite. fs.c then checks if the file name already exists and (if overwrite is "1") will overwrite or (if overwrite is "0") will not. I looked at FS_Search which used an "int" instead of "qboolean".
This is a gaping security hole.
VM_rename and MUST only operate within the data/ directory (where QC is allowed to mess with). See fopen() handling of writes.
As demos are written outside, this would need more changes then - we would have to change the default setting for where demos are stored, so they end up in data/ instead.
Cvars to change to achieve this:
cl_autodemo_nameformat (prepend data/ to current value)
sv_autodemo_perclient_nameformat (prepend data/ to current value)
These changes should be done from defaultXonotic.cfg and not in the engine.
The "ply" and "rec" aliases in defaultXonotic.cfg.
The demo list control.