FILE (UN)LOCKING

Started by MIRKOSOFT, August 19, 2010, 03:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

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
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

Hydrophilic

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.
I'm kupo for kupo nuts!