Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 51
Registered: ‎04-15-2013
My Device: Simulator
My Carrier: None

open vs fopen && lseek vs fseek and file descriptor going bad

hello,

 

Right now i am using open and lseek to do my file management. i have code to convert this to fopen and fseek with a compiler flag.

 

which is the prefered mechanism to use?

 

right now i open up a file and the beginning of my program and leave it open for the entire program (until exit) and lseek to the proper position. however after some time it appears as if the file descriptor is going bad.....

 

any suggestions?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: open vs fopen && lseek vs fseek and file descriptor going bad

Can't you use one of the higher level api's what's the data you are working on?

 

I use QFile with no problems, alongside other QT classes to manipulate data within a file.

 

The time to open and close a file should be fairly negliable on modern OS so just open and close as needed.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
New Developer
Posts: 51
Registered: ‎04-15-2013
My Device: Simulator
My Carrier: None

Re: open vs fopen && lseek vs fseek and file descriptor going bad

cant use qfile. question still stands...