LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-08-2020, 07:19 AM   #1
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Rep: Reputation: 0
Linux & file attributes ...


What I found puzzling when checking the file attributes for a specific folder on my laptop was that EVERY file had the A attribute, but no other attributes at all, just blank spaces before the filename! Since I need to know about the other attributes to determine which files were already marked with a read-only attribute so that I could change it/them so that would allow the files to be written to.

All of this is due to a message received after creating a FoxProW application and attempting to open it, which not possible due this error message: "Cannot write to a read-only file." Frankly, the message would be lots more helpful if it had told me WHICH file it could not write to. Right now, it's like looking for a needle in a haystack. Why would there not be other attributes associated with the files that already have just the A attribute?

I am wondering if Linux has a clever tool for working with file attributes. I am hoping that there might be a way to search all the files in a particular directory or folder for any files which are presently marked as "read-only".

I know that in order to be able to write to a file, there should be a "-R" attribute associated with it. My problem is trying to locate that particular file.

I hope this clarifies my difficulty and that there may be a way to search for files that presently have the "+R" (i.e. the read-only attribute) so that I can change it.

Any observations or suggestions would be appreciated.
 
Old 06-08-2020, 07:46 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,973

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by khunphet View Post
message received after creating a FoxProW application and attempting to open it, which not possible due this error message: "Cannot write to a read-only file."
You wrote the app so you should write it to report the file that it can't write.

Quote:
Originally Posted by khunphet View Post
I am wondering if Linux has a clever tool for working with file attributes. I am hoping that there might be a way to search all the files in a particular directory or folder for any files which are presently marked as "read-only".
This isn't a matter of attribute, but permission.
Files are readable, writable, and/or executable. 'read-only' isn't a permission (or an attribute), 'writable' is.

Code:
ls -l
returns the permissions of files in a directory, in the first 10 characters. The 9th is user writability


Quote:
Originally Posted by khunphet View Post
there may be a way to search for files that presently have the "+R" (i.e. the read-only attribute) so that I can change it.
You don't want to make every file writable, only the ones your app needs to write.

Last edited by RandomTroll; 06-08-2020 at 08:04 AM. Reason: correction
 
Old 06-10-2020, 03:42 AM   #3
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Original Poster
Rep: Reputation: 0
Linux & file attributes

Thanks for the enlightenment and the suggestion as well. They were useful indeed. Terminology always has a way of creating misunderstandings, but that's the way it goes.

Using your offerings, I have been able to solve the problem and all is now good, thanks to your involvement. Many thanks.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] best way in C in linux EXT3 or XFS to read file timestamps & attributes ron7000 Programming 3 06-17-2015 09:07 AM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
uploaded file on vsftpd has wrong file attributes rune.kg Linux - Newbie 2 03-06-2004 09:23 AM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:54 AM.

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