Hi group.
There is something in the behaviour of [file join] that I am not
understanding (yes, I read the manual)
I have a script to copy files to a folder in a local network machine,
actually a queue in a printer. The computer running the script is on
Windows 7, TCL is 8.6.3. The printer uses Solaris, but I presume that is
irrelevant as the error is in creating the destination address not in
copying the file.
I created the destination address like this:
> set printer \\\\192.168.1.171\\queue
> file join $printer
doc.ps
//
192.168.1.171/queue/doc.ps
And that works fine.
Recently I add to use more than one queue, so I chnged it so something as:
> set printer \\\\192.168.1.171
> puts [file join $printer queue
doc.ps]
/
192.168.1.171/queue/doc.ps
Which is not the intended path, it has a leading '/', not '//' (one not
two /s )
But if I do
> set printer \\\\192.168.1.171\\\\
> puts [file join $printer queue
doc.ps]
//
192.168.1.171/queue/doc.ps
it works again! So my script works, which is great :-) But I do not like
"magical code", so...
Why does this one work but the preceding one does not?
By the way, note that
> set printer \\\\192.168.1.171\\
> puts [file join $printer queue
doc.ps]
/
192.168.1.171/queue/doc.ps
also results in a single leading \
which only makes the result all the more mysterious to me.
--
{ricardo from
kozmate.net}