LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Making a file Read-only (https://www.linuxquestions.org/questions/linux-software-2/making-a-file-read-only-143494/)

Kujila 02-07-2004 08:15 PM

Making a file Read-only
 
I need to make a file read-only, so that this Windows program I'm using in WINE doesn't re-make the file that causes tself to crash.

I want to make the 0 byte, empty file without letting the WINE program over-write it with its version.

Thanks.

jtshaw 02-07-2004 08:20 PM

touch <filename> = creates file (will have 0 bytes as size)
chmod 444 <filename> = makes read only

Kujila 02-07-2004 08:22 PM

Thanks.

Kujila 02-07-2004 08:47 PM

Oop... The Windows program (under WINE) somehow managed to write a few bytes to it! :-X

jtshaw 02-07-2004 08:58 PM

Really? When you type ls -la <file-name> what does it show for the permissions?

Kujila 02-07-2004 09:08 PM

la <filename>

just shows me the filename again, with no additional information.

-la is not found as a command

jtshaw 02-07-2004 09:12 PM

ls -la <filename>

The above line is the command.

Kujila 02-07-2004 09:15 PM

(ACK! Sorry, didn't see the "ls" on your previous post, and I'm pretty Linux-newbie anyways! :) )


-r-------- 1 root root 0 Feb 7 21:07 custom.hpk

I am logged in as "root".

nightwulf 02-08-2004 12:14 AM

This is a good example of why not to run as root. ;)

Regards,
nightwulf

Kujila 02-08-2004 12:16 AM

That was very helpful indeed. :p


All times are GMT -5. The time now is 05:58 AM.