难怪,看了perldoc也没明白为啥linux不管的。
学习了。
2009/2/13 Qiang (James) <[email protected]>
> Michael Zeng wrote:
> > dear all:
> >
> > why
> >
> > use File::Spec ;
> > print File::Spec->rel2abs ( '..' )
> >
> > only get /ux/prj/prjhzeng/.. ?
> >
> > i want the absolute address , like /ux/prj
> >
> > thanks
> >
>
> rel2abs 最后还是通过 canonpath 来处理的,你的这里例子就变成
>
> # 假设当前目录是 /home/qiang
> File::Spec->rel2abs("../")
> File::Spec->canonpath("/home/qiang/..")
>
> 在 unix 系统里,为了尊重路径里有可能存在的 symbolic link(看 canonpath 文
> 档), canonpath 返回的值并不把这个相对路径解析。
>
> windows 里没有这么一说,所以会有不同的结果。
>
>
> Qiang(James)
>
>
--
blog - http://hi.baidu.com/smallfish7788
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
要在此论坛发帖,请发电子邮件到 [email protected]
要退订此论坛,请发邮件至 [email protected]
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---