Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  creating/editing (text)files
« previous next »
  • Print
Pages: [1]

Author Topic: creating/editing (text)files  (Read 1094 times)

Offline deute

  • Member
  • *
  • Posts: 2
creating/editing (text)files
« on: December 20, 2011, 09:45:18 AM »
Hi guys,
I want a plugin to create a file (in the same directory) or if it allready exists to change it.
Think these are the functions i could use. But  I am not sure how to use them.
 int (*open_utf8)(const char* pathname, int flags);
 int (*open)(const char* pathname, int flags, ...);
 int (*close)(int fd);
 int (*creat)(const char *pathname, mode_t mode);
 int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
 int (*read_line)(int fd, char* buffer, int buffer_size);

For example I don't know what flags I could pass to (*open). Or what is this , mode_t mode?
Maybe someone could explain at a little example to open a file and write something to it? Would be nice
Logged

Offline nls

  • Developer
  • Member
  • *
  • Posts: 460
Re: creating/editing (text)files
« Reply #1 on: December 20, 2011, 01:24:33 PM »
the file io stuff is (pretty close to) POSIX compliant so docs aplenty are available on the web. For example http://linux.die.net/man/2/open

The best documentation is the code so either look at the functions and see what they do or perhaps easier, look at other plugins and how they use them.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  creating/editing (text)files
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.145 seconds with 21 queries.