createfile_() on win98

Windows specific forum
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

createfile_() on win98

Post by blueznl »

can anybody point me in the right direction?

i can't seen to reliably use createfile_() under windows 98 to test if a file exists, and to retrieve information on that file, most likely because i don't use the right flags

but it works on xp :-(

now, the filesize() command of purebasic works, so that means there must be a way, and i am somewhat stupid...

anybody any suggestions what flags fred used? or another api?

(looks like under win98 i cannot, no matter what i try, reopen the same file with different flags, even when the win32.hlp and the msdk both suggest i can)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Fred
Administrator
Administrator
Posts: 18354
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

For the filesize() I don't use CreateFile_() but FindFirstFile_(). I hope this helps..
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

yes! thank you fred! that defintely helps, and explains the behaviour of filesize()...

i found out that on windows 98 each consequtive opening of a file (ie. retrieving a filehandle) is only allowed with (almost) identical flags... even retrieving the properties of an object or file (allowable according to win32.hlp and the psdk) doesn't work... guess what i used to retrieve file status and info...?

unfortunately, this also means that under 98 you cannot (easily) open ANY file that is explicitly exclusively opened :-( and there's no so called 'backup' mechanism on fat32 / win98...

fred, i suspect you use createfile_() with shared reading set in the openfile() command?

FAT32 EXACTLY the same sharing and access flags
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply