Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error 1224 (ERROR_USER_MAPPED_FILE) - what is it?

2,550 views
Skip to first unread message

Charlie Gibbs

unread,
Feb 1, 2008, 9:17:51 PM2/1/08
to
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?

--
/~\ cgi...@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!

David Lowndes

unread,
Feb 2, 2008, 4:47:12 AM2/2/08
to
>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).

I'd suspect interference from an anti-virus program. Can you check if
these users have an AV installed, and whether the problem disappears
if they remove it.

Dave

Charlie Gibbs

unread,
Feb 4, 2008, 1:31:50 PM2/4/08
to
In article <dte8q397ojqa5lotc...@4ax.com>,
Dav...@example.invalid (David Lowndes) writes:

Thanks, I'll check that one out.

nicolas....@gmail.com

unread,
Feb 6, 2008, 2:09:56 PM2/6/08
to
On Feb 4, 10:31 am, "Charlie Gibbs" <cgi...@kltpzyxm.invalid> wrote:
> In article <dte8q397ojqa5lotc64ieojt56atgua...@4ax.com>,
>
> Dav...@example.invalid (David Lowndes) writes:
> >> Occasionally, when I try toopenafilefor writing, I get error code

> >> 1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
> >> code is "Therequestedoperationcannotbeperformedon afilewith
> >> auser-mappedsectionopen."
>
> >> 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).
>
> > I'd suspect interference from an anti-virus program. Can you check if
> > these users have an AV installed, and whether the problem disappears
> > if they remove it.
>
> Thanks, I'll check that one out.

I've had this, and initially thought that I had too many files open
(forgot to close some files)
Actually, when reading other answers, I realized I have a regular
automatic backup that runs on the affected files.

Pooja Batra

unread,
Jan 30, 2021, 12:44:48 PM1/30/21
to
How the issue got resolved? I am getting same error randomly

Pooja Batra

unread,
Feb 5, 2021, 1:18:35 AM2/5/21
to
Please revert

余风

unread,
Nov 9, 2021, 1:46:59 AM11/9/21
to
I also got same error randomly,so have you resolved the problem?thx

Thomas Schmidt

unread,
Jun 20, 2023, 11:48:14 AM6/20/23
to
In my case (writing 6000 files via a Java program), the problem seemed to be Dropbox synchronisation somehow blocking the file writing. Paused Dropbox synch, error gone.

- Thomas

R.Wieser

unread,
Jun 20, 2023, 12:52:55 PM6/20/23
to
Thomas

> the problem seemed to be Dropbox synchronisation somehow blocking the
> file writing. Paused Dropbox synch, error gone.

Sounds like a reason :

[quote]
The full text corresponding to this code is "The requested operation cannot
be performed on a file with a user-mapped section open."
[/quote]

https://groups.google.com/g/comp.os.ms-windows.programmer.win32/c/plQmyXqAeOI

IOW, if DropBox is has a file open using a memory-mapped file method than
the writing to that same file using normal means is likely disallowed (the
files contents on the disk and the already-present "view of file" - cached
file contents - would mismatch).

One possible solution (no idea if you can delete a file that is
memory-mapped though) could be to delete the target file before writing a
fully new one.

Regards,
Rudy Wieser


0 new messages