Rockbox Development > Starting Development and Compiling

writing a file to a subfolder

(1/1)

andrewroth:
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.

Navigation

[0] Message Index

Go to full version