Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Apple Software > Mac OS X Forums > Mac OS X
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 22, 2009, 04:11 PM   #1
thriii
macrumors 6502
 
Join Date: Feb 2007
How to Make Sure a File is Never Replaced?

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?
thriii is offline   Reply With Quote
Old Nov 22, 2009, 04:13 PM   #2
dukebound85
macrumors 603
 
dukebound85's Avatar
 
Join Date: Jul 2005
why o why do i feel this is dealing with piracy?

call me a skeptic

what exactly are you worried about replacing op?
__________________
Old Bike:
2008 Kawasaki Ninja 250r Green
Current Bike:
2003 Suzuki SV650S Copper
dukebound85 is offline   Reply With Quote
Old Nov 22, 2009, 04:21 PM   #3
GGJstudios
macrumors 601
 
GGJstudios's Avatar
 
Join Date: May 2008
Location: Texas!
Quote:
Originally Posted by thriii View Post
... I replaced a file inside of the contents of an application ...
I'm not following why someone would want to do this, unless they're installing malware of some sort.
__________________
ǝlƃooʁШ ʎɹʇ ¿suoıʇsǝnb ǝɥʇ ʞsɐ noʎ ǝɹoɟǝq sɹǝʍsuɐ puıɟ oʇ ʇuɐʍ
GGJstudios is offline   Reply With Quote
Old Nov 22, 2009, 04:33 PM   #4
Bennieboy©
macrumors Demi-God
 
Bennieboy©'s Avatar
 
Join Date: Jan 2009
Location: england
Send a message via MSN to Bennieboy©
you could just buy the software, or being very very careful, ( no i am not condoning software piracy )
__________________
Cod biscuits bright my trousers :O
looking for an answer? MROOGLE IT!
Bennieboy© is offline   Reply With Quote
Old Nov 22, 2009, 06:08 PM   #5
angelwatt
macrumors 601
 
Join Date: Aug 2005
Location: Ohio
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.
__________________
MRoogle can find your answers!
Words on the Wall
angelwatt is offline   Reply With Quote
Old Nov 23, 2009, 12:57 AM   #6
larkost
macrumors regular
 
Join Date: Oct 2007
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.
larkost is offline   Reply With Quote
Old Nov 23, 2009, 02:18 PM   #7
thriii
Thread Starter
macrumors 6502
 
Join Date: Feb 2007
i laughed at the replies 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!
thriii is offline   Reply With Quote
Old Nov 23, 2009, 02:30 PM   #8
maflynn
Contributor
 
maflynn's Avatar
 
Join Date: May 2009
I suppose you can change the permissions to the file to read only, and that may "protect" it.
__________________
Unibody MacBook Pro 2.53 GHz, 4GB ram, 500GB HDD; iPhone 3Gs 32GB
maflynn is offline   Reply With Quote
Old Nov 23, 2009, 05:51 PM   #9
angelwatt
macrumors 601
 
Join Date: Aug 2005
Location: Ohio
Quote:
Originally Posted by thriii View Post
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.
__________________
MRoogle can find your answers!
Words on the Wall
angelwatt is offline   Reply With Quote
Old Nov 24, 2009, 01:04 AM   #10
GGJstudios
macrumors 601
 
GGJstudios's Avatar
 
Join Date: May 2008
Location: Texas!
Quote:
Originally Posted by thriii View Post
i laughed at the replies 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.
__________________
ǝlƃooʁШ ʎɹʇ ¿suoıʇsǝnb ǝɥʇ ʞsɐ noʎ ǝɹoɟǝq sɹǝʍsuɐ puıɟ oʇ ʇuɐʍ
GGJstudios is offline   Reply With Quote
Old Nov 24, 2009, 08:50 AM   #11
TonyK
macrumors regular
 
Join Date: May 2009
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.
TonyK is offline   Reply With Quote
Old Nov 24, 2009, 08:57 AM   #12
ss957916
macrumors 6502a
 
Join Date: Jun 2009
Quote:
Originally Posted by GGJstudios View Post
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.
ss957916 is offline   Reply With Quote
Old Nov 24, 2009, 09:29 AM   #13
MikeDTyke
macrumors 6502
 
Join Date: Sep 2005
Location: 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.
__________________
KISS is a principle i'd love to live by, if only life would allow.
MacPro 06 Quad 2.0GHz, 12GB, 60GB SSD, 3x250GB Stripe, 250GB XP & 2.7TB Drobo.
MikeDTyke is offline   Reply With Quote
Old Nov 24, 2009, 01:41 PM   #14
GGJstudios
macrumors 601
 
GGJstudios's Avatar
 
Join Date: May 2008
Location: Texas!
Quote:
Originally Posted by ss957916 View Post
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!
__________________
ǝlƃooʁШ ʎɹʇ ¿suoıʇsǝnb ǝɥʇ ʞsɐ noʎ ǝɹoɟǝq sɹǝʍsuɐ puıɟ oʇ ʇuɐʍ
GGJstudios is offline   Reply With Quote

Reply

Mac Forums > Apple Software > Mac OS X Forums > Mac OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:14 PM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2002-2010, MacRumors.com, LLC