How to Make Sure a File is Never Replaced?

thriii

macrumors 6502
Original poster
Feb 14, 2007
366
0
Hopefully there is an answer to this..

I replaced a file inside of the contents of an application and I was wondering if there is a way I could lock the file or somethin so it never gets replaced.. is this possible in any way? if not.. what else can I do to make sure the file works after updates?
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
Depends on what you mean by "never." From Finder, select file > Get Info > checkbox for Locked. That should be a reasonable effect. Admin will always be able to replace if desired, there's no getting around that.
 

larkost

macrumors 6502a
Oct 13, 2007
536
1
You are really not giving details, and all the important information is in the details. But you might want to take a look at the man page for 'chflags'. There are both the 'uchange' and the 'schange' flags that might do what you want to do.
 

thriii

macrumors 6502
Original poster
Feb 14, 2007
366
0
i laughed at the replies :p this doesnt have to deal with piracy at all.. I have 1Password and if you have it you know that it places an Icon which is usually "1P" in your browser bar by the back/forward buttons. it does this by putting a file in the firefox applications folder telling it to get the button image from inside the 1Password contents folder.. So I modded the Icon so it matches my firefox theme (just gotta figure out how to move the button down!)


I just dont want the png file for the button to be replaced if I upgrade 1password

So as you can see! no piracy! :)
 

maflynn

Moderator
Staff member
May 3, 2009
65,895
32,228
Boston
I suppose you can change the permissions to the file to read only, and that may "protect" it.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
I just dont want the png file for the button to be replaced if I upgrade 1password
The lock suggestion I gave may help, but something you want to think about is that if the updater cannot copy in a new file it could cause an error and break 1Password.
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
i laughed at the replies :p this doesnt have to deal with piracy at all..
As you can see from this thread, it helps if you fully describe what your problem is and what you're trying to accomplish. That way, you'll get more useful replies.
 

TonyK

macrumors 65816
May 24, 2009
1,027
144
There is one reason why someone may change a file in a package. 1Password does not support Camino 2 at this time. Thus we have to change a plist file for supported browsers. This is an official "hack" for 1Password to get Camino 2 to work. Nothing illegal about it. And it would be annoying to have to replace that change should 1Password do an update and over-write that file.

If a file is part of a package (single file application), I'm not sure you can prevent it from being replaced. The best bet is to create a folder mimicking the structure of the package and put a copy of the edited file there so it can be easily replaced as needed.
 

ss957916

macrumors 6502a
Jun 17, 2009
861
0
As you can see from this thread, it helps if you fully describe what your problem is and what you're trying to accomplish. That way, you'll get more useful replies.
As you can see from this thread, it helps if you don't jump to conclusions and just give people the benefit of the doubt. That way you don't waste your time falsely accusing people.
 

MikeDTyke

macrumors 6502a
Sep 7, 2005
661
0
London
sudo chflags schg name_of_file.png

Is the daddy of file locking. Set this and not even root can remove the file. It is system immutable...

If you do want to remove afterward, boot your mac into single user mode with command+s. cd to the relevant directory and enter:

chflags noschg name_of_file.png

No one can say if a 1Password update will fail if it tries to update the file. A case of try and see, and if it does you can unset the flag and make a backup copy of the image. to re-apply after.

Job as they say is a good un. :)
 

GGJstudios

macrumors Westmere
May 16, 2008
44,427
762
As you can see from this thread, it helps if you don't jump to conclusions and just give people the benefit of the doubt. That way you don't waste your time falsely accusing people.
I didn't jump to any conclusions. Nor did I make any assumptions about or accuse anyone of anything. Reading comprehension is a good thing! You should try it!
 

Similar threads

  • Golfmusician
6
Replies
6
Views
174
  • dyzfnctional
6
Replies
6
Views
344
Replies
6
Views
322
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.