_stat and _utime synchronization

Daniel Choi 26 Reputation points
2021-04-07T06:25:17.397+00:00

Hi, I'm working on a project regarding time, and I 'm trying to read/write time data from different processes.

I'm thinking of using _stat/_utime to read/write time data, and I was wondering if anyone knew how _Stat and _utime manages synchronization.

_utime sets the modified Time and Access Time for a file, while _stat can get those data.

Could there be a race condition when using these two functions? or, could _stat read data while _utime is writing the data mid way and return corrupted Data?

I couldn't find a way for RWLock for windows between processes (SRWLock seems to be for threads only), and I'm wondering if using _stat and _utime is safe enough.

Thanks!

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,431 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,546 questions
{count} votes