Page 1 of 1

createfile_() on win98

Posted: Sun Jun 27, 2004 10:39 pm
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)

Posted: Mon Jun 28, 2004 10:48 am
by Fred
For the filesize() I don't use CreateFile_() but FindFirstFile_(). I hope this helps..

Posted: Mon Jun 28, 2004 10:58 am
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