Moving file out of starkit.

1 view
Skip to first unread message

John Culleton

unread,
Apr 11, 2009, 9:12:43 AM4/11/09
to starkit
In the same tyro.tcl app mentioned earlier I want to move a
file out of the vfs and make it visible to other programs.
I assume I can use a call in my tcl program like
exec cp workfile ../../../
but if there is a better way I would appreciate some advice.

Further, I assume the MSWin version would be
exec cp workfile ..\..\..\

I can't test this code yet because of the difficulty I
mentioned earlier today.
--
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com

Pat Thoyts

unread,
Apr 13, 2009, 5:42:24 AM4/13/09
to John Culleton, starkit
2009/4/11 John Culleton <jo...@wexfordpress.com>:

>
> In the same tyro.tcl app mentioned earlier I want to move a
> file out of the vfs and make it visible to other programs.
> I assume I can use a call in my tcl program like
> exec cp workfile ../../../
> but if there is a better way I would appreciate some advice.
>
> Further, I assume the MSWin version would be
> exec cp workfile ..\..\..\
>
> I can't test this code yet because of the difficulty I
> mentioned earlier today.

file copy

Here is one I use for copying a certificate file (openssl won't read
it from the vfs either)

proc copy_ca_file {} {
global env
set path [file join $::tkchat_dir certs.pem]
if {![file exists $path]} { return {} }
if {[lindex [file system $path] 0] ne "native"} {
set new {}
foreach var {TEMP TMP TMPDIR} {
if {[info exists env($var)] \
&& [file isdirectory $env($var)] \
&& [file writable $env($var)]} then {
set new [file join $env($var) tkchat.pem]
break
}
}
if {$new eq {}} {
if {[file isdirectory /tmp] && [file writable /tmp]} {
set new [file join /tmp tkchat.pem]
} else {
log::log error "cannot find a tempfile location"
return {}
}
}
log::log info "copying certificate collection to $new"
file copy -force $path $new
return $new
}
return $path
}

Pat Thoyts

Reply all
Reply to author
Forward
0 new messages