It would be good if the command had a flag that could disable the creation of a new file.PB help wrote:Opens a file for reading/writing or creates a new file if it does not exist.
If the file does not exist then #False should be returned.
It would be good if the command had a flag that could disable the creation of a new file.PB help wrote:Opens a file for reading/writing or creates a new file if it does not exist.
Code: Select all
If FileSize(path) > -1 ;only open the file if it already exists
OpenFile(fileID, path)
Endif
E.g. the name #PB_File_Existing would be more intuitive then.Sicro wrote:If the file does not exist then #False should be returned.
No, I don't mean that. That would be a different feature request.Sicro wrote:@Little John:
You mean it should work the other way around: Instead of disabling the creation of the file with the flag #PB_File_NoCreate, there should be a flag #PB_File_Existing that enables the creation?
Okay, I'm fine with that, too.Little John wrote:#PB_File_Existing (short for #PB_Open_Only_An_Already_Existing_File) rather than #PB_File_NoCreate