[Implemented] #PB_File_SharedWrite in ReadFile()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

[Implemented] #PB_File_SharedWrite in ReadFile()

Post 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) 
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

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

Post 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.
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

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

Post by mestnyi »

It is a pity that no one supported.
I fully support :D
Post Reply