Thread unix major number ermitteln (7 answers)
Opened by bora99 at 2011-08-30 18:07

GwenDragon
 2011-08-30 18:43
#151968 #151968
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
Ich dachte, die major number steht in Array-Eintrag 0 des stat-Ergebnis?

Schnippsel t.pl zum Test:
Code: (dl )
1
2
3
4
my $snum = shift;
my $file = shift;
my ($i) = (stat $file)[$snum];
print $i;


root@se ~ # stat /dev/null
File: `/dev/null'
Size: 0 Blocks: 0 IO Block: 4096 character special file
Device: 5h/5d Inode: 600 Links: 1 Device type: 1,3
Access: (0666/crw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2011-08-27 17:11:24.570047736 +0200
Modify: 2011-08-27 17:11:24.570047736 +0200
Change: 2011-08-27 17:11:24.570047736 +0200
root@se ~ # perl t.pl 0 /dev/null
5
root@se ~ #


//EDIT: Obwohl glaube ich, bei special devices der Eintrag 6 von stat gilt.

Ich bin nicht sicher, ob wir beide dasselbe meinen.
Last edited: 2011-08-30 18:54:16 +0200 (CEST)
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread unix major number ermitteln