Discussion:
SetEndOfFile failed with mapped file error
(too old to reply)
Ron Happel
2003-07-02 16:33:25 UTC
Permalink
If get the following error when I call SetEndOfFile():

ERROR_USER_MAPPED_FILE - The requested operation cannot be
performed on a file with a user-mapped section open.

However, I have not created a file mapping object for the
file so why am I getting this error? Multiple processes
have this data file open for read/write at the same time,
but access is controlled. This have been well tested. This
has only happened on Windows XP so far.

Any help appreciated.
Nick Ryan
2003-07-02 19:26:38 UTC
Permalink
Post by Ron Happel
ERROR_USER_MAPPED_FILE - The requested operation cannot be
performed on a file with a user-mapped section open.
However, I have not created a file mapping object for the
file so why am I getting this error? Multiple processes
have this data file open for read/write at the same time,
but access is controlled. This have been well tested. This
has only happened on Windows XP so far.
Any help appreciated.
This error is returned from the filesystem when an attempt is made to
truncate a file that has an existing user-mode mapping. SOME process
SOMEWHERE has mapped this file. You may want to start killing all
running processes one-by-one until you're able to truncate again.
--
- Nick Ryan
- Microsoft MVP for DDK
Alexander Grigoriev
2003-07-03 02:46:52 UTC
Permalink
I suspect it may be also returned if another application at that moment does
a read or write operation beyound the required new end of file, especially
in cached mode, or if there are blocks cached for it (less likely, though).
Post by Nick Ryan
Post by Ron Happel
ERROR_USER_MAPPED_FILE - The requested operation cannot be
performed on a file with a user-mapped section open.
However, I have not created a file mapping object for the
file so why am I getting this error? Multiple processes
have this data file open for read/write at the same time,
but access is controlled. This have been well tested. This
has only happened on Windows XP so far.
Any help appreciated.
This error is returned from the filesystem when an attempt is made to
truncate a file that has an existing user-mode mapping. SOME process
SOMEWHERE has mapped this file. You may want to start killing all
running processes one-by-one until you're able to truncate again.
--
- Nick Ryan
- Microsoft MVP for DDK
Nick Ryan
2003-07-03 07:48:56 UTC
Permalink
I'm pretty sure it's only user file mappings that can cause this error
to be returned (the internal file mappings used by the Cache Manager
don't count). There should be no race conditions with reads/writes on
other handles that can cause an EOF change on a handle opened with valid
access rights to fail; to block for a while, maybe, but not fail.
Post by Alexander Grigoriev
I suspect it may be also returned if another application at that
moment does a read or write operation beyound the required new end of
file, especially in cached mode, or if there are blocks cached for it
(less likely, though).
Post by Nick Ryan
Post by Ron Happel
ERROR_USER_MAPPED_FILE - The requested operation cannot be
performed on a file with a user-mapped section open.
However, I have not created a file mapping object for the
file so why am I getting this error? Multiple processes
have this data file open for read/write at the same time,
but access is controlled. This have been well tested. This
has only happened on Windows XP so far.
Any help appreciated.
This error is returned from the filesystem when an attempt is made to
truncate a file that has an existing user-mode mapping. SOME process
SOMEWHERE has mapped this file. You may want to start killing all
running processes one-by-one until you're able to truncate again.
--
- Nick Ryan
- Microsoft MVP for DDK
--
- Nick Ryan (MVP for DDK)
Loading...