![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Location: India
Posts: 2
Rep Power: 0
![]() |
Command to find file attributes
hi guys,
Is there any command or function through which i can get attributes of a file like following attributes hidden archive read etc |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Please note that it is against forum rules to cross-post. Be a real gentleman and READ the friggin' rules, wouldya?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
Those attributes are for Windows files, not UNIX files. e.g., there is no such thing as a hidden UNIX file.
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
Using `ls -lastr` would give you a decent list of file properties. The "hidden" files in linux are typically called "dot files". If you preceed the filename with a dot (as in .fileName), it would "hide" from the default `ls` command.
The -a flag of the ls command would find all dot files, so in effect they aren't really hidden. However, you could probably effectively hide a file by prefixing the filename with nongraphic characters. Although the -b flag of `ls` would print octal escapes in the place of the nongraphic character... The use of -b is not as commonly known as -a. When in doubt, encrypt the file and change ownership and permissions.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
IF -
I disagree - you can hide unix files the way you describe but stat - which is the definitive statement about file properties -- does not have any such thing as hidden in UNIX files. Windows filesystems support that property - as well as archive, etc. I am not arguing "functionality" I'm arguing defined properties - what you did was to confuse the poor OP. IMO. I guess shell scripting includes windows/DOS bat files. There isn't a stat shell command available from standard Windows XP distributions, so that leaves UNIX ![]() Well, Linux stat.... Hence, the comment. |
|
|
|
|
|
#6 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
By the way, Windows files having the archive flag means nothing. I've seen many non-archive files with it.
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|