Forum

Mac OS X und BSD Flags
Februar 06, 2008, 19:09:39
Bin bei einer versuchten Hilfestellung in einem anderen Forum auf eine seltsame Problematik gestossen. Hat sich eventuell schonmal jemand mit den BSD Flags befasst und kann mir helfen?

Gemäss man pages von ls sollte jenes bei einem Aufruf mit den -ol Flags eigentlich die BSD Flags mit ausgeben. Tut es unter OS X aber irgendwie nicht. Habe testweise bei einer Datei auf meinem Desktop das uchg Flag gesetzt. Bei einem Versuch, die Datei mit rm zu löschen, wird das Flag auch tatsächlich berücksichtigt und rm löscht die Datei nicht. Lasse ich die Datei von ls -ol listen, dann wird dort das uchg Flag nicht angegeben. Jemand ne Ahnung, wie man unter OS X die BSD Flags sichtbar machen kann?
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

mbs

Re: Mac OS X und BSD Flags
Antwort #1: Februar 06, 2008, 21:54:59
Zitat
Hat sich eventuell schonmal jemand mit den BSD Flags befasst und kann mir helfen?

Na, klar...  :)

Zitat
Lasse ich die Datei von ls -ol listen, dann wird dort das uchg Flag nicht angegeben. Jemand ne Ahnung, wie man unter OS X die BSD Flags sichtbar machen kann?

Es kommt darauf an, ob Du Leopard oder eine frühere Version benutzt. In "alten" Versionen ist "ls -ol" richtig. In Leopard muss man dagegen das "O" groß schreiben :D.

Ein "ls -Ol" sollte es also tun. Das kleine "o" heißt in Leopard "omit group owner".
Re: Mac OS X und BSD Flags
Antwort #2: Februar 07, 2008, 07:29:50
Cool, danke. Meine Versuche unternahm ich in der Tat mit Leo. Dass er den group owner omitted ist mir aufgefallen. Aber auf diese Idee wäre ich trotzdem nicht gekommen.  :)

Woher wusstest Du? Apple scheint es bis jetzt ja immerhin verpasst zu haben, die man pages anzupassen. Darwin-Quellcodestudium?
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

mbs

Re: Mac OS X und BSD Flags
Antwort #3: Februar 07, 2008, 10:21:49
Zitat
Apple scheint es bis jetzt ja immerhin verpasst zu haben, die man pages anzupassen. Darwin-Quellcodestudium?

Das mache ich auch... Aber bei mir funktionieren eigentlich auch die man pages?  :P
Re: Mac OS X und BSD Flags
Antwort #4: Februar 07, 2008, 10:25:10
Echt? Das steht bei Dir so drin?  ???

Öhm, 10.5.2?
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

mbs

Re: Mac OS X und BSD Flags
Antwort #5: Februar 07, 2008, 10:32:16
Zitat
Öhm, 10.5.2?

*hüstl* Geht auch in 10.5...
Re: Mac OS X und BSD Flags
Antwort #6: Februar 07, 2008, 10:48:50
Gehen schon. Aber ob es schon korrekt in den man pages steht ist die Frage.  ;)

Muss heute abend an meinem Mac in dem Fall noch mal kucken, ob ich da wirklich so schräg gelesen habe oder ob es bei mir (mit 10.5.1) tatsächlich noch falsch steht.
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

mbs

Re: Mac OS X und BSD Flags
Antwort #7: Februar 07, 2008, 11:33:17
Zitat
Gehen schon. Aber ob es schon korrekt in den man pages steht ist die Frage.

Ja, ja, das meinte ich. Das steht ab 10.5 auch so in den man pages.

Angeblich schon seit 19.05.2002, aber das stimmt nicht, da hat man wohl wieder mal was von FreeBSD abgeschrieben. Ich vermute, die Änderung des o-Flags ist eine Notwendigkeit für die UNIX-2007-Zertifizierung.
Re: Mac OS X und BSD Flags
Antwort #8: Februar 07, 2008, 15:59:42
Also geträumt hatte ich doch nicht.
Zitat
LS(1)                     BSD General Commands Manual                    LS(1)

NAME
     ls -- list directory contents

SYNOPSIS
     ls [-ABCFGHLPRTWZabcdefghiklmnopqrstuwx1] [file ...]

DESCRIPTION
     For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information.
     For each operand that names a file of type directory, ls displays the names of files contained within that directory, as well as any
     requested, associated information.

     If no operands are given, the contents of the current directory are displayed.  If more than one operand is given, non-directory operands
     are displayed first; directory and non-directory operands are sorted separately and in lexicographical order.

     The following options are available:

...snip...

-o      Include the file flags in a long (-l) output.

...snip...

COMPATIBILITY
     The group field is now automatically included in the long listing for files in order to be compatible with the IEEE Std 1003.2 (``POSIX.2'')
     specification.

SEE ALSO
     chflags(1), chmod(1), sort(1), xterm(1), compat(5), termcap(5), symlink(7), sticky(8)

STANDARDS
     The ls utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').

HISTORY
     An ls command appeared in Version 1 AT&T UNIX.

BUGS
     To maintain backward compatibility, the relationships between the many options are quite complex.

BSD                              May 19, 2002                              BSD
???

_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

VollPfosten

  • Never mind the Pfosten!
Re: Mac OS X und BSD Flags
Antwort #9: Februar 07, 2008, 18:56:59
Vielleicht kein Clean Install? ;)

Bei mir (10.5.1) steht:
Zitat
-O      Include the file flags in a long (-l) output.
Re: Mac OS X und BSD Flags
Antwort #10: Mai 23, 2008, 20:45:29
Ich kram den Thread nochmal hervor. Es hat nicht zufälligerweise jemand eine Ahnung, welches API ls verwendet, um die BSD Flags in Erfahrung zu bringen?
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)

mbs

Re: Mac OS X und BSD Flags
Antwort #11: Mai 23, 2008, 21:18:17
Doch, klar.  ;)

Das geht mit stat() und fflagstostr().

Zur Not könntest Du Dir auch den Originalquellcode von ls im Darwin-Paket "file_cmds" anschauen …
Re: Mac OS X und BSD Flags
Antwort #12: Mai 23, 2008, 21:23:37
Danke Dir. (Bin selbst auch gerade drauf gestossen. Meistens findet man selbst doch noch, was man länger gesucht hat, sobald man irgendwo fragt.  ;)   - fflagstostr() brauch ich nicht. Brauche sie als UInt32.)
_______
Complete liberty of contradicting and disproving our opinion, is the very condition which justifies us in assuming its truth for purposes of action; and on no other terms can a being with human faculties have any rational assurance of being right. (John Stuart Mill - On Liberty)