in reply to including modules during runtime and dealing with OS specific (constants) code block
Second, since you're using Win32::File, it doesn't do any good to try darwin. I eliminated darwin, and I deleted the eval. There was also a problem with &error_dialog being undefined, so I deleted that. Here's what I have so far:use Win32::File qw(:DEFAULT SetAttributes GetAttributes);
#!perl BEGIN { $| = 1; $^W = 1; } use strict; use warnings; use Win32::File qw( :DEFAULT SetAttributes GetAttributes ); my $name = '/root/Desktop/foo.txt'; my $attr = 0; Win32::File::SetAttributes( $name, $attr ); Win32::File::GetAttributes( $name, $attr ); if ( $attr & SYSTEM ) { print "$name has SYSTEM set.\n"; } if ( $attr & HIDDEN ) { print "$name is hidden.\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: including modules during runtime and dealing with OS specific (constants) code block
by armstd (Friar) on Aug 02, 2011 at 17:26 UTC |