>>*--------------------------------------------------------------------------- >>function do_it() >> >> ?DriveReadOnly('A') >> >>endfunc >>*--------------------------------------------------------------------------- >>#DEFINE SEM_FAILCRITICALERRORS 0x0001 >>#DEFINE SEM_NOGPFAULTERRORBOX 0x0002 >>#DEFINE SEM_NOALIGNMENTFAULTEXCEPT 0x0004 >>#DEFINE SEM_NOOPENFILEERRORBOX 0x8000 >> >>function DriveReadOnly(DriveLetter) >> >> DECLARE INTEGER SetErrorMode IN win32api INTEGER >> >> do case >> case len(DriveLetter) == 1 >> DriveLetter = DriveLetter + ':' >> endcase >> >> local n, FileName, fd, DriveReadOnly >> n = SetErrorMode(0) >> =SetErrorMode( bitor(n, SEM_FAILCRITICALERRORS) ) >> >> && uncomment following line to get the dialogue >> &&=SetErrorMode( bitand(n, bitnot(SEM_FAILCRITICALERRORS)) ) >> >> FileName = addbs(DriveLetter) + sys(3) >> >> fd = fcreate(FileName) >> do case >> case fd < 0 >> DriveReadOnly = TRUE >> >> otherwise >> DriveReadOnly = FALSE >> =fclose(fd) >> delete file (FileName) >> >> endcase >> >> =SetErrorMode(n) >> >> return DriveReadOnly >>endfunc >>*--------------------------------------------------------------------------- >>>>>Hi Gregory,