小编Pav*_*vel的帖子

File :: Spec-> catpath不适用于Windows

我使用的File::Spec模块,像这样

my $volume = 'C';

my $path = File::Spec->catpath(
    $volume,
    File::Spec->catdir('panel', 'texts'),
    'file'
);

print $path;
Run Code Online (Sandbox Code Playgroud)

产量

Cpanel\texts\file
Run Code Online (Sandbox Code Playgroud)

如何在Perl中构建与OS无关的文件路径中File::Spec讨论的可移植模块如何?如果我必须写音量C:\而不只是C为了正确吗?

windows perl path

-1
推荐指数
1
解决办法
242
查看次数

标签 统计

path ×1

perl ×1

windows ×1