Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

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, 23:30 GMT+2
Last edited by Jonas Häggqvist (rasher) - Thursday, 08 November 2007, 12:19 GMT+2
Task Type Patches
Category Simulator
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
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.
(application/octet-stream)    simrootdirargument.diff (6.2 KiB)
 uisimulator/common/io.c |   29 ++++++++++++++---------------
 uisimulator/sdl/uisdl.c |   25 +++++++++++++++++++++----
 2 files changed, 35 insertions(+), 19 deletions(-)

This task depends upon

Closed by  Jonas Häggqvist (rasher)
Thursday, 08 November 2007, 12:19 GMT+2
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, 23:40 GMT+2
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, 08:00 GMT+2
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, 11:00 GMT+2
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, 12:19 GMT+2
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.
(application/octet-stream)    simrootdirargument_2.diff (8 KiB)
 uisimulator/common/io.c |   49 +++++++++++++++++++++++-------------------------
 uisimulator/sdl/uisdl.c |   30 +++++++++++++++++++++++++----
 2 files changed, 50 insertions(+), 29 deletions(-)

Comment by Jonas Häggqvist (rasher) - Wednesday, 08 November 2006, 12:21 GMT+2
Forgot one buffer.
(application/octet-stream)    simrootdirargument_3.diff (8.1 KiB)
 uisimulator/common/io.c |   51 +++++++++++++++++++++++-------------------------
 uisimulator/sdl/uisdl.c |   30 ++++++++++++++++++++++++----
 2 files changed, 51 insertions(+), 30 deletions(-)

Comment by Steve Bavin (pondlife) - Wednesday, 01 August 2007, 17:51 GMT+2
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...