Thread Windows Dateiattribute abfragen (8 answers)
Opened by bianca at 2011-02-01 14:48

GwenDragon
 2011-02-01 17:14
#145252 #145252
User since
2005-01-17
14601 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w
use strict;
use warnings;

my $errorbindings;
BEGIN {
        eval "use Win32::File qw/ :DEFAULT /";
        if ($@) {
                $errorbindings = $@;
        }
}
if (!$errorbindings) {
        if (Win32::File::GetAttributes("$0", my $attributes)) {
                if ( $attributes & SYSTEM ) {
                        print "Attribut S fuer $0 ist gesetzt\n";
                }
        }
}
else { print "Schrott: >$errorbindings<\n" }  

geht wenn ich das Dateiattribut des Perprogramms auf System setze.

Editiert von GwenDragon: Tabs neu gesetzt
Last edited: 2011-02-01 17:16:18 +0100 (CET)

View full thread Windows Dateiattribute abfragen