Thread stat() - Was steckt genau im mode Feld? (19 answers)
Opened by FReAK La Marsch at 2003-08-23 17:24

esskar
 2003-08-24 14:33
#76322 #76322
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
ich glaube, das geht nicht mit stat
da musst du schon -f und -d nehmen...
bzw.

probier es mal so

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
use strict;
use Fcntl ':mode';

my $dir = "C:\\folder";
my $file = "c:\\test.txt";
my $mode;

$mode = (stat($file))[2];
print "Is '$file' a folder? " . S_ISDIR($mode) ? "Yes" : "No";
$mode = (stat($dir))[2];
print "Is '$dir' a folder? " . S_ISDIR($mode) ? "Yes" : "No";

View full thread stat() - Was steckt genau im mode Feld?