Support #1268

Renaming demo files

Added by XonColin almost 2 years ago. Updated 7 months ago.

Status:NewStart date:07/23/2012
Priority:NormalDue date:
Assignee:-% Done:


Target version:0.8


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.

Demo_Rename.diff Magnifier (10.5 KB) XonColin, 07/23/2012 11:24 pm

darkplaces.diff Magnifier (9.35 KB) XonColin, 07/24/2012 01:03 pm

Demo_Rename.diff Magnifier (11 KB) XonColin, 07/24/2012 04:23 pm

darkplaces.diff Magnifier - Changes made in xonotic/darkplaces/ (9.79 KB) XonColin, 07/25/2012 01:13 pm

Demo_Rename.diff Magnifier - Changes made in qcsrc (11.1 KB) XonColin, 07/25/2012 01:13 pm

darkplaces.diff Magnifier (9.77 KB) XonColin, 07/25/2012 03:23 pm


#1 Updated by XonColin over 1 year ago

Added the diff for the changes i made to dark places (sorry for the mess).

#2 Updated by XonColin over 1 year ago

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 over 1 year 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".

#4 Updated by XonColin over 1 year ago

fs.c now uses an actual gboolean to check for overwrite.

#5 Updated by Mirio 11 months ago

  • Target version set to 0.8
  • % Done changed from 40 to 0

#6 Updated by divVerent 7 months ago

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.

Also available in: Atom PDF