Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Check if unicode directory exists

by Anonymous Monk
on Aug 06, 2012 at 08:50 UTC ( #985631=note: print w/ replies, xml ) Need Help??

Comment on Re: Check if unicode directory exists
Replies are listed 'Best First'.
Re^2: Check if unicode directory exists
by Anonymous Monk on Aug 06, 2012 at 09:12 UTC

    The wordy approach

    use Fcntl q' :mode '; use Win32::Unicode::Native; use Data::Dump; my $filename = shift; my @f = my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename); dd \@f, S_ISDIR( $mode ), S_ISREG($mode);

    Less wordy

    #!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use File::stat(); use Win32::Unicode::Native; # stat is statW, open is openW, ... for my $filename ( @ARGV ){ my $stat_obj = File::stat::populate( stat( $filename ) ); dd $filename, $stat_obj, { isdir => -d $stat_obj, isfile => -f $st +at_obj }; } __END__ $ perl win32.unicode.stat.utf8.pl . win32.unicode.stat.utf8.pl ( ".", bless([3, 0, 16895, 1, 0, 0, 3, 0, 1344244307, 1344244307, 115650180 +3, "", ""], "File::stat"), { isdir => 1, isfile => "" }, ) ( "win32.unicode.stat.utf8.pl", bless([3, 0, 33206, 1, 0, 0, 3, 444, 1344244390, 1344244390, 1344244 +307, "", ""], "File::stat"), { isdir => "", isfile => 1 }, )

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-07-30 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls