#include ONCE "window9.bi"

function Open_File (sFileName as string, flag as Long = 0) as HANDLE export
	
	dim as FILE ptr fp = fopen(sFileName, "r+b")
	
	if fp = 0 then
	
		fp = fopen(sFileName, "wb")

	EndIf 

	if fp = 0 then
	
		fp = cast(handle,-1)

	EndIf	
	
	return fp

End Function