Page 1 of 1

[Implemented] #PB_File_SharedWrite in ReadFile()

Posted: Fri Feb 01, 2013 9:56 am
by User_Russian
According to the help, in PB 5.10, the function ReadFile() does not support #PB_File_SharedWrite. http://purebasic.developpez.com/documen ... dfile.html
In this case, is unable to open one and the same file for read/write and read-only.

Code: Select all

Debug OpenFile(2, "C:\Test.txt", #PB_File_SharedRead) 
Debug ReadFile(0, "C:\Test.txt" , #PB_File_SharedRead|#PB_File_SharedWrite)   ; #PB_File_SharedWrite not supported!
Requires such access is to the file, and to do this, the function ReadFile() should support #PB_File_SharedWrite.

Code: Select all

; Read / Write.
Debug CreateFile_("C:\Test.txt", #GENERIC_READ|#GENERIC_WRITE, #FILE_SHARE_READ, 0, #OPEN_ALWAYS, #FILE_ATTRIBUTE_NORMAL, 0)

; Read only.
Debug CreateFile_("C:\Test.txt", #GENERIC_READ, #FILE_SHARE_READ|#FILE_SHARE_WRITE, 0, #OPEN_EXISTING, #FILE_ATTRIBUTE_NORMAL, 0) 

Re: [PB 5.10] #PB_File_SharedWrite in ReadFile()

Posted: Sat Jul 06, 2013 4:00 pm
by User_Russian
It is a pity that no one supported.
Strangely when the file is opened as read-only, you can not just open for reading and writing.

Re: [PB 5.10] #PB_File_SharedWrite in ReadFile()

Posted: Sun Oct 19, 2014 7:48 am
by mestnyi
It is a pity that no one supported.
I fully support :D