• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compile, running OK but no result

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I want to create a program that writes the names of all locales to a file :

the class is compiled and run without any problem, but checking AllLocales.txt file, it contains nothing.
any ideas why ??
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea behind a BufferedWriter is that it groups a series of small IO operations, into a single large operation. It is usually more efficient to do a single large operation than several small operations if the overhead of doing an operation is high (as it is with IO). However, if you have not placed enough information in the buffer to cause it to automatically empty, you must do so manually with a call to the flush() method before your program terminates. Failure to do so will cause the data in the buffer to be lost.
It is a good practice to always call flush() and close() when you are done with a stream.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!