| View previous topic :: View next topic |
| Author |
Message |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sat May 26, 2007 2:04 pm Post subject: How not to interrupt fileIO when shutting down PSP |
|
|
Hi Guys,
A log file is saved to MS anytime a program that I'm writing exits, and
the size of the log file is depends on how long the program has been running,
and what events have been logged, etc.
I leave a lengthy delay to make sure the file writing is complete before using
PSPStandby to shut down the PSP.
Now most of the time it's only saving a small file, and waiting a big delay for nothing.
Is there a way to tell at runtime that the file access is finished so I
can have it exit quicker?
Cheers, Art. |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
sectoid
Joined: 28 May 2007 Posts: 3
|
Posted: Tue May 29, 2007 12:20 pm Post subject: |
|
|
yea fflush sounds like what you need to use..
#include <stdio.h>
int fflush(FILE *FP);
`fflush' returns `0' unless it encounters a write error; in that situation, it returns `EOF'. |
|
| Back to top |
|
 |
cloudhunter
Joined: 17 Aug 2006 Posts: 86
|
Posted: Tue May 29, 2007 11:56 pm Post subject: |
|
|
Used fflush myself, worked fine :)
Cloudy _________________ :) |
|
| Back to top |
|
 |
|