Charlie Gibbs
2008-02-02 02:17:51 UTC
Occasionally, when I try to open a file for writing, I get error code
1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
code is "The requested operation cannot be performed on a file with
a user-mapped section open."
This condition only occurs once in a while, at a couple of the 2000
or so installations where this program runs (under Win2K or XP).
There's nothing special about the file; it's a text file containing
data which I want to preserve from run to run. During initialization,
my program opens this file, reads its contents into memory, then
closes it. The memory image contains totals that are updated while
the program runs. Upon shutdown (usually after running for several
hours to a day), the program opens the file for output, writes out
the updated totals, then closes the file. No other program uses
this file - or even knows that it exists - and the one program that
maintains it only has it open for a fraction of a second at startup
and again at shutdown. There are no known resource leaks, and I'm
quite meticulous about closing files as soon as I'm done with them.
I've tried adding error handling code that displays the file's
attribute bits (only FILE_ATTRIBUTE_ARCHIVE is set), as well as
running Sysinternals utility HANDLE.EXE, which states that nobody
has the file open.
Does anyone have any idea what this error means?
1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
code is "The requested operation cannot be performed on a file with
a user-mapped section open."
This condition only occurs once in a while, at a couple of the 2000
or so installations where this program runs (under Win2K or XP).
There's nothing special about the file; it's a text file containing
data which I want to preserve from run to run. During initialization,
my program opens this file, reads its contents into memory, then
closes it. The memory image contains totals that are updated while
the program runs. Upon shutdown (usually after running for several
hours to a day), the program opens the file for output, writes out
the updated totals, then closes the file. No other program uses
this file - or even knows that it exists - and the one program that
maintains it only has it open for a fraction of a second at startup
and again at shutdown. There are no known resource leaks, and I'm
quite meticulous about closing files as soon as I'm done with them.
I've tried adding error handling code that displays the file's
attribute bits (only FILE_ATTRIBUTE_ARCHIVE is set), as well as
running Sysinternals utility HANDLE.EXE, which states that nobody
has the file open.
Does anyone have any idea what this error means?
--
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!