...
Exclusive access grants unrestricted file access to the locking process while denying access to all other processes and eliminates the potential for a race condition on the locked region. (See Secure Coding in C and C++, Chapter 7 8[Seacord 2005a2013].)
Files, or regions of files, can be locked to prevent two processes from concurrent access. Windows supports two types of file locks:
...
[Austin Group 2008] | |
[HP 2003] | |
[Kennaway 2000] | |
[Open Group 2004] | mktemp() mkstemp() open() |
[Seacord 2005a2013] | Chapter 3, "Pointer Subterfuge" Chapter 78, "File I/O" |
[Viega 2003] | Section 2.1, "Creating Files for Temporary Use" |
[Wheeler 2003] | Chapter 7, "Structure Program Internals and Approach" |