English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Say U r writing a list of names to a file one name per write statement. Why is it not a good idea to close the file after every write statement and reopen it before the next write?

2007-10-08 03:39:09 · 1 answers · asked by model3girl 2 in Computers & Internet Other - Computers

1 answers

Think about it this way. If you had to make repeated trips, in succession, into your house, would you lock/unlock the door for every trip or just leave the door open until you were done? Working with reading/writing to a file is very similar in that you'll have a performance hit when opening/closing the file.

2007-10-08 03:43:28 · answer #1 · answered by Jim Maryland 7 · 0 0

fedest.com, questions and answers