Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Files *

Status
Not open for further replies.

carlosAlberto

IS-IT--Management
Oct 9, 2001
109
GB
Hi,

When saving files in TCL I think it only checks that this is possible when it actually tries to close the file.

i.e. you can do : puts $file "fgfgfgf"

But when you actually do $close file, this is when it saves.

Is there a way I can put a check routine into this.

i.e. if (close $file == *error*)
puts "It was not possible to save your file"

I have limited space on my server which often becomes full. (no available money in the budget)
 
Something like this might work:

set file1 [open "/filename" w+]
puts $file_start_write "bogusstring."
if {[catch {close $file1) err]} {
puts "$err occurred saving file $file1."
rcoverspace_proc
} else {
puts "Saved $file1 okay.."
}
With rcoverspace_proc being fictional.

 
Something like this might work:

set file1 [open "/filename" w+]
puts $File1 "bogusstring."
if {[catch {close $file1) err]} {
puts "$err occurred saving file $file1."
rcoverspace_proc
} else {
puts "Saved $file1 okay.."
}
With rcoverspace_proc being fictional.

 
sorry.for the typos, hope you get the idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top