Hi!
As every user of 64HDD knows that simple locking and unlocking files is with these commands:
OPEN 1,11,15,â€F-L:FILE.PRGâ€
CLOSE 1
OPEN 1,11,15,â€F-U:FILE.PRGâ€
CLOSE 1
Is possible to do this without 64HDD? On real drives, exactly: exists any command to (UN)LOCK file?
Many many thanks.
Miro
There is no command for this on Commodore floppy drives like 1541/71/81. Maybe on some third-party drives, but I don't know of any. On Commodore drives you have to read in the sector from the directory, modify bit 6 of the "file type" byte, then write the sector back onto the disk.
As I recall, $82 = normal PRG, $C2 = locked PRG, $02 = splat PRG. Of course there are other values, but this should be enough to get you started.