Discussion:
Error 1224 (ERROR_USER_MAPPED_FILE) - what is it?
(too old to reply)
Charlie Gibbs
2008-02-02 02:17:51 UTC
Permalink
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?
--
/~\ ***@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
2008-02-02 09:47:12 UTC
Permalink
Post by Charlie Gibbs
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
2008-02-04 18:31:50 UTC
Permalink
Post by David Lowndes
Post by Charlie Gibbs
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.
Thanks, I'll check that one out.
--
/~\ ***@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!
n***@gmail.com
2008-02-06 19:09:56 UTC
Permalink
Post by Charlie Gibbs
Post by David Lowndes
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
2021-01-30 17:44:45 UTC
Permalink
Post by n***@gmail.com
Post by Charlie Gibbs
Post by David Lowndes
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.
How the issue got resolved? I am getting same error randomly
Pooja Batra
2021-02-05 06:18:34 UTC
Permalink
Post by Pooja Batra
Post by n***@gmail.com
Post by Charlie Gibbs
Post by David Lowndes
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.
How the issue got resolved? I am getting same error randomly
Please revert
余风
2021-11-09 06:46:58 UTC
Permalink
在 2021年1月31日星期日 UTC+8 上午1:44:48,<Pooja Batra> 写道:
Post by Pooja Batra
Post by n***@gmail.com
Post by Charlie Gibbs
Post by David Lowndes
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.
How the issue got resolved? I am getting same error randomly
I also got same error randomly,so have you resolved the problem?thx
Thomas Schmidt
2023-06-20 15:48:12 UTC
Permalink
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
2023-06-20 16:52:30 UTC
Permalink
Thomas
Post by Thomas Schmidt
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

Continue reading on narkive:
Loading...