[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] LS
--- Thescripter@xxxxxxx wrote:
> Hi, i have a perl script that checks owner ship of files (via the ls -ls
> command). But i have a username that is horsecenter and it on the ls -ls it
>
> is too long and shows as horsecen, how do i change this or how can my
> scripts view teh owner of the file?
Take a look at the perl command stat and the module File::stat ... this will
allow you to obtain the uid of the file's owner, which you can then translate
to the file's owner
#!/usr/bin/perl
use File::stat;
$st = stat("foo.pl");
print "this file is owned by" , $st->uid;
Paul
__________________________________________________
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
http://invites.yahoo.com