forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How not to interrupt fileIO when shutting down PSP

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat May 26, 2007 2:04 pm    Post subject: How not to interrupt fileIO when shutting down PSP Reply with quote

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
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Sun May 27, 2007 9:36 am    Post subject: Reply with quote

use fflush before fclose ?
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
sectoid



Joined: 28 May 2007
Posts: 3

PostPosted: Tue May 29, 2007 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
cloudhunter



Joined: 17 Aug 2006
Posts: 86

PostPosted: Tue May 29, 2007 11:56 pm    Post subject: Reply with quote

Used fflush myself, worked fine :)

Cloudy
_________________
:)
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group