Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: andrewroth on December 09, 2010, 10:03:26 PM

Title: writing a file to a subfolder
Post by: andrewroth on December 09, 2010, 10:03:26 PM
hi all

I'm making good progress on my workout plugin, but I'm having trouble writing a new file to a subfolder.  This is in the simulator.

works:    rb->open("/file.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);

doesn't:    rb->open("/folder/file.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);

I'm running the program under the same user that owns "folder" so I don't think it's a unix file permissions thing.  There's no error or failure, just the file doesn't get created.

I also tried stuff like

rb->open(ROCKBOX_DIR "/folder/file.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);
rb->open(ROCKBOX_DIR "folder/file.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);

after doing some greps in apps/plugins to see how other plugins do it.  No go.  Any ideas?  Many thanks.