I tried using
File::stat (which would be another way to do this) but I couldn't grasp what it was doing..
It suggests something like:
use File::stat;
$st = stat($file) or die "No $file: $!";
if ( ($st->mode & 0111) && $st->nlink > 1) ) {
print "$file is executable with lotsa links\n";
}
My problem was the
0111 and how I could tell if the file was writeable even if it were a readable and executable by group/user/world.. those are different numbers. I guess I would have to know and test against these numbers..
Does anyone have any insight on that? In the interim, there is this oogly thing..
my @listfiles=`ls -l ./`;
foreach(@listfiles) {
chomp;
$_=~s/ /\t/g;
my @details = split(/\t/, $_);
print "$details[-1]: $details[0]\n";
}
it works, but then, it's just a
ls -l of the contents of the dir. whoo.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.