[comp.sys.mac.system] how to lock file names

jd231825@longs.lance.Colostate.Edu (Jeff Detweiler) (02/18/91)

Joe,

You can lock the file name by checking the "System" bit with Resedit,
Disktop, etc.  If you have Resedit, use the "get info" option under
the file menu once you've clicked on the file in question, and click
in the box that says "System".  As far as I know checking the System
bit only locks the file name and does not interfere w/ other system
files.  Hope this helps!

Jeff
jd231825@longs.lance.colostate.edu

delac@midas.mgmt.purdue.edu (Chas. DeLa) (02/19/91)

Jeff Detweiler writes:

JD>   You can lock the file name by checking the "System" bit with Resedit,
JD>   Disktop, etc.  If you have Resedit, use the "get info" option under
JD>   the file menu once you've clicked on the file in question, and click
JD>  in the box that says "System".  As far as I know checking the System
JD>   bit only locks the file name and does not interfere w/ other system
JD>   files.  Hope this helps!

Jeff,

I tried this out (used ResEdit to change the "System" check box to "on" in 
ResEdit Get Info), but was able to change the name afterwards even though I'd saved the ResEdit changes.  What gives?

I'd like to be able to do this, but unless I had brain-lock, the proposed 
solution didn't produce the desired effect.   Also, is there a way to 
prevent a file from being deleted which doesn't use the file level Get 
Info lock box?


Chas. DeLa                         delac@midas.mgmt.purdue.edu
Information Center Specialist      delac@purccvm
Krannert Computer Center           (317) 494-9564
Purdue University

cfry@jove.cs.pdx.edu (Chall Fry) (02/19/91)

In article <1991Feb18.164429.16489@zeus.mgmt.purdue.edu> delac@midas.mgmt.purdue.edu (Chas. DeLa) writes:

[Quotes earlier stuff about setting the System bit to lock a file's name]

>I tried this out (used ResEdit to change the "System" check box to "on" in 
>ResEdit Get Info), but was able to change the name afterwards even though
>I'd saved the ResEdit changes.  What gives?

>I'd like to be able to do this, but unless I had brain-lock, the proposed 
>solution didn't produce the desired effect.   Also, is there a way to 
>prevent a file from being deleted which doesn't use the file level Get 
>Info lock box?

Sorta from memory, so correct me if I'm wrong ...

When you open a folder in the Finder, the File Info record (containing the
flags and such) is brought into memory. Changing the info in ResEdit
doesn't update the Finder's memory-resident copy until you close and
re-open the window. At this point the name should be unchangeable.

There are a couple of ways to keep files from getting deleted which are
more secure than locking them. The invisible bit (settable in ResEdit) is
good, as you can't delete files you can't see. (they'll still show up in
SFxxxFile dialogs, however, and in utilities such as DiskTop). There's also
the File Protect bit, which absolutely keeps a file from being deleted by
any program not specifically designed to deal with it, and ResEdit (for
reasons I don't really understand**) won't let you set/unset this bit. Some
programs, such as DiskTop and DiskTools II (there's also something on
Sumex) allow you to set this bit.

Apple might have something to say about the using the Protect bit, but I
can't find in IM or in a glance at the TechNote index, so buyer beware.

**ResEdit seems to have turned off a few of the checkboxes in the File Info
dialog. I checked the DITL, and the items are enabled, but they won't
change state wihen clicked upon. Are the FInfo boxes covered in a TMPL?
(they're not exactly a resource ...) If not, [how] can you enable the
protect (and busy, I suppose) options? Patching a CODE somewheres? Or do
you just use some modifier combo? Or, are the boxes really 'display only.'
Ack.

--Chall Fry         cfry@jove.cs.pdx.edu
"Chall, 'nifty' I can deal with, but 'goshums' is just too much." -Anastasia

delac@midas.mgmt.purdue.edu (Chas. DeLa) (02/20/91)

Chall Fry writes in response to my question:

CF>   When you open a folder in the Finder, the File Info record 
      (containing the
CF>   flags and such) is brought into memory. Changing the info in ResEdit
CF>   doesn't update the Finder's memory-resident copy until you close and
CF>   re-open the window. At this point the name should be unchangeable.

Quite so...just as you say.  This addresses one part of the question.  In terms of protecting a file from deletion ,I think I (we) have a copy of DiskTools somewhere so I'll give this a try.  ResEdit definitely won't let you set the "file protect" bit.  

Chas.

Chas. DeLa                                   delac@midas.mgmt.purdue.edu
Information Center Specialist       delac@purccvm
Krannert Computer Center           (317) 494-9564
Purdue University

jd231825@longs.lance.Colostate.Edu (Jeff Detweiler) (02/22/91)

In article <1991Feb18.164429.16489@zeus.mgmt.purdue.edu> delac@midas.mgmt.purdue.edu (Chas. DeLa) writes:


   I tried this out (used ResEdit to change the "System" check box to "on" in 
   ResEdit Get Info), but was able to change the name afterwards even though I'd saved the ResEdit changes.  What gives?


Quite frankly, I don't know what gives!  :-)  I just now tried it w/
an old version Resedit (1.2) and it worked fine.  Maybe try Disktop in
the sumex archives (it's a DA):  it can do the same.

Good luck,

Jeff

jd231825@longs.lance.colostate.edu