Author Topic: FILE (UN)LOCKING  (Read 585 times)

0 Members and 1 Guest are viewing this topic.

Offline MIRKOSOFT

  • C128 user
  • ******
  • Posts: 785
  • Age: 33
  • Location: Zvolen
  • Activity:
    3.6%
  • Country: sk
  • Reputation: 188
  • Gender: Male
  • C128 programmer
  • With us since: 13/02/2009
    YearsYearsYearsYears
    • View Profile
    • MIRKOSOFT
FILE (UN)LOCKING
« on: August 19, 2010, 02:28 AM »
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!!!

64ever 128her
sixty-for-ever one-twenty-either

C128 = C64² + more

http://www.mirkosoft.sk

Offline Hydrophilic

  • 128D user
  • *******
  • Posts: 1214
  • Age: 41
  • Location: Earth... still!
  • Activity:
    0%
  • Reputation: 232
  • Gender: Male
  • With us since: 25/01/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • H2Obsesson
Re: FILE (UN)LOCKING
« Reply #1 on: August 19, 2010, 05:53 PM »
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!

 



Back to top