-
Sep 2nd, 2021, 01:55 PM
#1
Thread Starter
Lively Member
Does WritePrivateProfileString close the file after the write?
Likewise, does GetPrivateProfileString do so after a read?
-
Sep 2nd, 2021, 02:17 PM
#2
Re: Does WritePrivateProfileString close the file after the write?
Yes, every time you read or write, you have to open and close the file.
-
Sep 2nd, 2021, 02:19 PM
#3
Thread Starter
Lively Member
Re: Does WritePrivateProfileString close the file after the write?
So neither API actually does the opening or closing?
-
Sep 2nd, 2021, 03:16 PM
#4
Re: Does WritePrivateProfileString close the file after the write?
The file is opened with no sharing, effectively locking it. Then the entire file is read and parsed or rewritten. Then the file is closed, effectively unlocking it.
-
Sep 2nd, 2021, 04:20 PM
#5
Thread Starter
Lively Member
Re: Does WritePrivateProfileString close the file after the write?
Originally Posted by dilettante
The file is opened with no sharing, effectively locking it. Then the entire file is read and parsed or rewritten. Then the file is closed, effectively unlocking it.
Ahh OK. I have a program where window location and size is corrupted if the program crashes. Other entries in the .ini aren't affected and I write window location on program end or unloading that particular window
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|