Rockbox

Tasklist

FS#6303 - Add argument to specify root dir in simulator

Attached to Project: Rockbox
Opened by Jonas Häggqvist (rasher) - Tuesday, 07 November 2006, 22:30 GMT
Last edited by Jonas Häggqvist (rasher) - Thursday, 08 November 2007, 11:19 GMT
Task Type Patches
Category Simulator
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch adds a --rootdir argument to allow selecting the root directory when launching the simulator. Quite simple really, but could be handy in a number of situations.
This task depends upon

Closed by  Jonas Häggqvist (rasher)
Thursday, 08 November 2007, 11:19 GMT
Reason for closing:  Out of Date
Additional comments about closing:  No longer needed as of r15526
Comment by Jonas Häggqvist (rasher) - Tuesday, 07 November 2006, 22:40 GMT
I just realised that using a large path for the rootdir would seriously diminish the possible size of the largest path allowed in the sim. I suppose I could just make all the buffers in io.c be 2*MAX_PATH, but really they should be strlen(rootdir)+MAX_PATH to match the target as close as possible, but that's probably too complex for me to handle. If anyone wants to help me out, please do!
Comment by Steve Bavin (pondlife) - Wednesday, 08 November 2006, 07:00 GMT
I would find this patch very useful, currently I have my music collection stored on a server and only copy over a subset to my "archos" directory.

I think that the MAX_PATH*2 solution is the way forward - assuming it only affects the low-level file i/o (which it should).
Comment by Jonas Häggqvist (rasher) - Wednesday, 08 November 2006, 10:00 GMT
Yes. I just thought of that. Isn't the stuff in common/io.c a level below the Rockbox i/o? In that case, using 2*MAX_PATH shouldn't be a problem at all. Now comes another issue. Is it even a reasonable to use MAX_PATH (260) for a unix or windows path? Can't they be much larger than that?
Comment by Jonas Häggqvist (rasher) - Wednesday, 08 November 2006, 11:19 GMT
Updated patch that adds a restriction of MAX_PATH for the rootdir argument (should be enough in most cases) and changes buffers in io.c to use 2*MAX_PATH instead of 256 as previously.
Comment by Jonas Häggqvist (rasher) - Wednesday, 08 November 2006, 11:21 GMT
Forgot one buffer.
Comment by Steve Bavin (pondlife) - Wednesday, 01 August 2007, 15:51 GMT
Jonas, if you could resync this, I'd like to commit it... although I don't think paths should be any more than MAX_PATH anywhere.

Loading...