Re: Weird behaviour of [file copy symlink ...]
From: Benjamin Riefenstahl (Benjamin.Riefenstahl_at_epost.de)
Date: 03/17/04
- Next message: Benjamin Riefenstahl: "Re: TIP #172: Improve UNIX Tk Look and Feel"
- Previous message: Benjamin Riefenstahl: "Re: disabling font substitution"
- In reply to: Matthias Kraft: "Re: Weird behaviour of [file copy symlink ...]"
- Next in thread: Joe English: "Re: Weird behaviour of [file copy symlink ...]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Mar 2004 15:39:49 +0100
Hi Matthias,
Matthias Kraft <Matthias.Kraft@nospam.softwareag.com> writes:
> As I already pointed out, most symlinks are relative, thus this
> mycopy procedure needs to walk into the directories:
>
> proc mycopy {f1 f2} {
> set orgDir [pwd]
> file stat $f1 -
> cd [file dirname $f1]
> while {![catch {file readlink $f1} l1]} {
> cd [file dirname $l1]
> set f1 [file basename $l1]
> }
> file copy -- $f1 $f2
> cd $orgDir
> }
Couldn't you avoid the "cd" with
[file join [file dirname $f1] [file readlink $f1]]
?
benny
- Next message: Benjamin Riefenstahl: "Re: TIP #172: Improve UNIX Tk Look and Feel"
- Previous message: Benjamin Riefenstahl: "Re: disabling font substitution"
- In reply to: Matthias Kraft: "Re: Weird behaviour of [file copy symlink ...]"
- Next in thread: Joe English: "Re: Weird behaviour of [file copy symlink ...]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]