Rockbox Development > Starting Development and Compiling
can i read file from my plugin??
saratoga:
--- Quote from: restart on June 17, 2008, 10:42:42 PM ---
--- Quote from: bluebrother on June 15, 2008, 09:03:19 AM ---use the standard open() / read() functions.
--- End quote ---
i've got errors in using open() and read () functions.
--- Code: ---VirtualGuide.c:(.text+0x90): undefined reference to `open'
VirtualGuide.c:(.text+0x98): undefined reference to `strcpy'
VirtualGuide.c:(.text+0x9c): undefined reference to `read'
--- End code ---
can you help me??
--- End quote ---
Kind of hard without seeing the code, but I'm going to guess that you didn't try rb->open().
bluebrother:
There are several plugins accessing files so it shouldn't be hard to find examples. Plugins need to use the plugin API structure pointer for accessing core functions (that pointer is usually named "rb").
restart:
i am so confused where i should put my files ???
can anyone help me? i am trying to open file but the path is always not right...
---------------------------------------------------------------------------------------------------
here it is my code
--- Code: ---fp = rb->open("help.txt", O_WRONLY|O_CREAT);
--- End code ---
and the errors
--- Code: ---WARNING, bad file name lacks slash: help.txt
WARNING, bad file name lacks slash: help.txt
--- End code ---
mschneider:
It's telling you you really dont have a file specified. A path to a file normally has various "slashes" (C:\Documents and Settings\Administrator), that's what the error is. It really doesnt matter where you put your files as long as they stay there and you dont just have the file name. Instead of "help.txt" you need to put a path to where the file is "/.rockbox/plugins/help.txt".
bluebrother:
--- Quote from: mschneider on June 18, 2008, 06:24:38 PM ---A path to a file normally has various "slashes" (C:\Documents and Settings\Administrator), that's what the error is.
--- End quote ---
Err, those are backslashes. A backslash is an escape character in C, so if you want to access a file "c:\test.txt" you need to double the \ in the code, i.e. write "c:\\test.txt". But Rockbox internally uses forward slashes (and there is no drive letter), so you get something like in the last example.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version