I write the engine for our company's products, which are designed to run on our clients kiosks.  This includes code to commit file writes to disk.

We have no control over the client's choice of hardware or OS, and for the first time we've been given Windows 7 Embedded to work with.  Suddenly, our secure writes have started failing if power is lost immediately after the flush.

Although including commode.obj causes fflush to commit, even on Win7, I've always preferred to use the MS-specific commit mode flag ("c") on Windows (the Linux version uses a completely different method), because as I write the library not the products, I can never be sure that commode.obj has actually been included, so I can't throw an error.

FILE* p_f = fopen("foo.dat", "wbc");
fwrite(p_important_stuff, 1, size, p_f);
fflush(p_f);


So my question is: Is the commit mode flag broken on Win7, and if so is there a way I can guarantee commode.obj is included, or is there some other way I can change the state of the global commit flag?


Question: Set leading of paint / fontmetrics in android
Answer: From the documentation for getFontMetrics (emphasis mine):


  Return the font's recommended interline spacing, given the Paint's settings for typeface, textSize, etc. If metrics is not null, return the fontmetric values in it.


You don't set this to change spacing, you read this to determine what the recommended spacing should be. You'll have to reposition coordinates manually yourself, i.e. translating the canvas again between drawing each line.