[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FDclone-users:00314] Re: cannot enter ./ in an archive



At Fri, 16 Jul 2004 19:22:46 +0900,
Takashi SHIRAI wrote:
>  そもそも「.」は「./foo」のような pathname の時でも不要なの
> で、pathname の取得の際に無駄な「.」や「..」は削除してしまう
> realpath() 的な処理の方がいいかも知れません。
>  それだと、ついでに「../foo」とか「foo/../bar」とか混在する
> 場合にも対処出来るようになりますし。
> 
>  一応仕様としては、
> 	./foo		-> foo
> 	foo/./bar	-> foo/bar
> 	foo/../bar	-> bar
> 	/../foo	-> /foo
> 	../foo	-> ../foo
> のように正規化するルールにしてみました。

 正規化してしまうと、ファイルの閲覧や抽出などができません。
厄介なことですが、 tar(1) はパス名の正規化ということはしない
ので、「./foo」として格納されているファイルを「foo」と言っても
それとは認識してくれません。

- GNU tar
- SunOS 5.7 tar
- OpenBSD tar (pax(1)ベース)
- FreeBSD tar (libarchiveベース; 独自)

で確認し、いずれも「foo」ではマッチしませんでした。

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"It seems to me as we make our own few circles 'round the sun
          We get it backwards and our seven years go by like one"