Re: Problem in opening a file




Ranjan schrieb:
I do agree that the example I mentioned will not make any difference by
writing pwd, but actually i want to create result file somewhere else
eg [pwd]/a/b/result.txt

Does the directory exist? [open] doesn't create directories, mkdir will
(if needed):
file mkdir a/b
set fp [open a/b/result.txt a+]
(Relative paths always refer to [pwd] anyway).

Also, have you checked whether [exec pwd] might return backslashes as
path separators on Windows... Tcl's [pwd] is always the recommended
choice.

.



Relevant Pages