Memory Levels: 2 Modifying Files on the FFS

Up: GEOS SDK TechDocs | Up | Prev: 1 Memory Levels | Next: 3 Operations that Consume FFS Space
FoamWarnForSaving(), FoamSaveAction

Whenever you perform an operation that modifies a file on the FFS, you should make sure that you have enough space to save the file. For example, you may bring up a document, modify it, and then wish to close the app, saving the document as it now exists.

In those case, use FoamWarnForSaving() to make sure you can proceed with the operation. Pass this routine the number of bytes required for the operation. The routine checks if there is enough memory available for the operation. If there is, it returns FSA_SAVE_DATA. Otherwise, it initiates a dialog box that asks you whether you wish to either throw away the changes or cancel the operation.

FoamWarnForSaving() returns one of the following FoamSaveAction values:

FSA_SAVE_DATA
The operation is well within the limits.
FSA_THROW_AWAY_CHANGES
The operation could not proceed due to memory constraints, and the user chose to discard the changes. Proceed accordingly. (You might, for example, allow the app to close.)
FSA_DO_NOTHING
The operation could not proceed due to memory constraints, and the user chose to cancel the operation. Proceed accordingly. (You should not allow the app to close, for example.)

Up: GEOS SDK TechDocs | Up | Prev: 1 Memory Levels | Next: 3 Operations that Consume FFS Space