LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-07-2004, 08:15 PM   #1
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Rep: Reputation: 30
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.
 
Old 02-07-2004, 08:20 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
touch <filename> = creates file (will have 0 bytes as size)
chmod 444 <filename> = makes read only
 
Old 02-07-2004, 08:22 PM   #3
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Original Poster
Rep: Reputation: 30
Thanks.
 
Old 02-07-2004, 08:47 PM   #4
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Original Poster
Rep: Reputation: 30
Oop... The Windows program (under WINE) somehow managed to write a few bytes to it! :-X
 
Old 02-07-2004, 08:58 PM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Really? When you type ls -la <file-name> what does it show for the permissions?
 
Old 02-07-2004, 09:08 PM   #6
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Original Poster
Rep: Reputation: 30
la <filename>

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

-la is not found as a command
 
Old 02-07-2004, 09:12 PM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
ls -la <filename>

The above line is the command.
 
Old 02-07-2004, 09:15 PM   #8
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Original Poster
Rep: Reputation: 30
(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".
 
Old 02-08-2004, 12:14 AM   #9
nightwulf
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 35

Rep: Reputation: 15
This is a good example of why not to run as root.

Regards,
nightwulf
 
Old 02-08-2004, 12:16 AM   #10
Kujila
Member
 
Registered: Jan 2004
Location: United States
Distribution: Mandrake 9.2
Posts: 158

Original Poster
Rep: Reputation: 30
That was very helpful indeed.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making VSAM file from a flat file in AIX Raghothaman AIX 2 08-25-2004 04:55 PM
how do I make a read-only file NOT read-only? robster Linux - General 1 02-17-2004 09:11 PM
Making a Windows partition read/write for all users d1v1d38yz3r0 Linux - Newbie 2 12-08-2003 02:10 PM
Making Ark and KDE file manager read ZIP files. xode Linux - Software 3 10-13-2003 03:12 PM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration