Created
April 24, 2012 20:50
-
-
Save bokutin/2483600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use utf8; | |
use File::Spec; | |
use Win32::Unicode; | |
# フルパス = フォルダ名 + ファイル名 | |
my $path = File::Spec->catfile("c:/Documents and Settings", "萌え♥.txt"); | |
sayW $path; # C:\Documents and Settings\萌え♥.txt | |
# ファイルを作成してみる | |
my $file = Win32::Unicode::File->new(">", $path); | |
$file->print("Hello"); | |
$file->close; | |
# フルパスを分解してみる | |
{ | |
my ($volume,$directories,$file) = File::Spec->splitpath($path); | |
sayW $volume; # C: | |
sayW $directories; # \Documents and Settings\ | |
sayW $file; # 萌え♥.txt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment