Re: Leaving files open on CE device 100% of the time
From: Michael J. Salamone [eMVP] (mikesa#at#entrek#dot#com)
Date: 03/17/04
- Next message: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Previous message: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- In reply to: Stephen Bye: "Re: Leaving files open on CE device 100% of the time"
- Next in thread: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Reply: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 17 Mar 2004 05:13:55 -0800
That's not a problem. The OS doesn't just kill your app, it sends WM_CLOSE.
You have an opportunity, then, to free up resources, flush buffers (if you
have your own internal buffering), close files, etc.
Additionally, data you write is immediately commited to storage, because
there is no file system caching in CE (at least not any file system I am
aware of). So even if the OS did zap you, your data will be on disk (unless
you have your own internal buffering, and didn't actually do the write).
-- Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell Microsoft! https://www.windowsembeddedeval.com/community/newsgroups Michael Salamone [eMVP] Entrek Software, Inc. www.entrek.com "Stephen Bye" <.> wrote in message news:OdlCQlBDEHA.2920@TK2MSFTNGP09.phx.gbl... > If the OS needs to close your application to free up memory, or if the user > does a soft reset, then you will lose the contents of the file if the file > is open. > It would probably be better to keep all of the data in memory (if that is > possible), and write it to the file when it is changed. If that would be too > often, you could check every 10 minutes, say, if the data has changed since > the last time you saved it, and write it then. > > "CheshireCat" <blahhh@blahhhhh.com> wrote in message > news:uiP3$yADEHA.3280@TK2MSFTNGP09.phx.gbl... > > Can anyone give me reasons why I shouldn't open a data file at the time my > > data handling object is created, closing it again on it's destructor. The > > file is a data file and the object reads and writes to it over its > lifetime. > > Or would it be safer to keep opening/closing the file as I need it. > > There will be 4 persistent instances of the object in the application. The > > application will be running 100% of the time as this is a dedicated app > for > > the CE device . The data has to be safe etc. The file would only be closed > > when a replacement data file is downloaded to the handheld. > > I want to do it this way to keep speed up, cut down on the amount of > > coding/error checking and to keep the application footprint as small as > > possible. > > > > > > > >
- Next message: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Previous message: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- In reply to: Stephen Bye: "Re: Leaving files open on CE device 100% of the time"
- Next in thread: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Reply: CheshireCat: "Re: Leaving files open on CE device 100% of the time"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|