problem on writing to a file
Moderators: silvia, selimgunay, Moderators
problem on writing to a file
I would like to write the $folder amount every time after the file OUTPUT.TXT opend.how can i write this code? here is the code that i used it for writing but evey time instead of writing $folder in new line it delet the prevous amout and writes only the new one.
[code]set fileId [open D:/OUTPUT.txt w 0600]
puts $fileId " $folder"
close $fileId[/code]
[code]set fileId [open D:/OUTPUT.txt w 0600]
puts $fileId " $folder"
close $fileId[/code]
Thank you for your reply, I had the same problem. 

Last edited by mexkuz on Mon Oct 06, 2014 12:16 am, edited 1 time in total.
Re: problem on writing to a file
yeah, if create a file, use the CREAT tag;
how can I create and then append?
how can I create and then append?
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: problem on writing to a file
open the file with a w to create it .. if you need to cloe the file in the script, open it subsequently with an a to append to it.
if you don't close it you don''t have to open it again.
if you don't close it you don''t have to open it again.
-
- Posts: 4
- Joined: Mon May 27, 2013 4:07 pm
- Location: Las Vegas, NV
Re: problem on writing to a file
Ahh I had this same problem. Seems like common sense after I fixed it =/
I'm a current master student at UMD researching geology and simulation software architecture. I also enjoy cycling, golf and writing for http://www.ultius.com
-
- Posts: 1
- Joined: Wed May 20, 2020 9:36 am
- Contact:
Re: problem on writing to a file
Kampala International University (KIU) founded in 2001 is a private chartered University in the Republic of Uganda. It is a member of the Association of Commonwealth Universities, the Association of Africa Universities as well as the Inter University-Council of East Africa. KIU offers a variety of programs in Health Sciences, Science and Technology, Engineering, Business and Management, Law, Humanities and Education.
https://kiu.ac.ug/
https://kiu.ac.ug/
-
- Posts: 1
- Joined: Thu Jul 23, 2020 10:41 pm
- Contact:
Re: problem on writing to a file
Thanks for sharing
Latest Update: Get $20 off $100 Target Promo Code
-
- Posts: 1
- Joined: Fri Aug 07, 2020 7:01 am
- Contact:
Re: problem on writing to a file
Informative thanks for sharing
-
- Posts: 2
- Joined: Wed Feb 24, 2021 7:01 am
- Contact:
Re: problem on writing to a file
Thank you to share this with us.
Get 20% OFF TurboTax Code and Home Depot Discount