Re: [Activetcl] file content does not update
by Thomas Wunderlich other posts by this author
Oct 30 2009 6:34AM messages near this date
view in the new Beta List Site
Re: [Activetcl] file content does not update
|
[Activetcl] Tclcurl and ActiveTcl extension repository
Hello,
You've right, flush is included in the close command.
Flushing on a closed file handle brings nothing!
I think it is better to use an update (or update idletime)
command to give the surrounding TCL-system the
chance to write his cache out. This is like a "sync"
under linux or a <F5-Key> in Windows-File-Explorer.
Greetings, Thomas
-----Original Message-----
From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com] On Behalf Of Mahmood
Naderan
Sent: Friday, October 30, 2009 2:23 PM
To: activeTcl
Subject: Re: [Activetcl] file content does not update
> try to include to flush $out2
Thanks that did the job, but I think 'close' command should also
flush the buffer.
accrding to manual for 'close' command "All buffered output is
flushed to the channel's output device". Then why should I use 'flush'
seperatly after 'close':
set out2 [open "cabprop.dat" a+]
# add some strings
close $out2
flush $out2
# destroy window
_mnaderan
________________________________
From: Tillmann A. Basien | ToolBox Solution GmbH <tab@[...].de>
To: Mahmood Naderan <nt_mahmood@[...].com>
Sent: Fri, October 30, 2009 12:19:35 PM
Subject: Re: [Activetcl] file content does not update
try to include to flush $out2
Mahmood Naderan schrieb:
I wrote a program that by clicking the the "save"
button, some strings are appended to a file.
set out2 [open "cabprop.dat" a+]
# add some strings
close $out2
# destroy window
The problem is after the window (the window that
contains "save") has closed, the file content won't get updated. I have
to close the main window and after that the text editor prompts for
reloading the file. I don't know why... 'close' command should close the
file but it doesn't work until the main window is closed.
Thanks,
_mnaderan_
Thread:
Mahmood Naderan
Mahmood Naderan
Mahmood Naderan
Larry W. Virden
Thomas Wunderlich
|