Hmm. I spoke far too soon. find2perl's code is about going from the permission to the symbolic meaning. The code at the head of this thread is to go the other way, albeit for the wrong reason (from what I can gather).
So, the code is neither the best way to do something, nor something that is parallel to what find2perl does.
-- Randal L. Schwartz, Perl hacker | [reply] |
While working on the parser that uses that permissions converter.. I was reminded of the reason I used the above method to parse the permissions. The file I am trying to obtain permissions for resides on a remote server which does not have Perl. I use Expect to SSH into the remote system and retrieve the output from a long listing on the file. Since the file does not reside on the local system I cannot use stat() on the file.
| [reply] |