Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing to File  RSS feed

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to figure out why this will not actually print to the file
Any help would be appreciated



 
Saloon Keeper
Posts: 8618
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's way too much code for any of us to debug. Isolate the part that's not working, tell us what result you are expecting and what it actually does.
 
Marshal
Posts: 5593
384
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All that code looks like could be quite shortened, as there are lots of code repetition.
 
mike statham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes sorry it does repeat for other files, Problem is that it doesn't print to the file at all

 
Saloon Keeper
Posts: 1814
238
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

mike statham wrote:... Problem is that it doesn't print to the file at all


Are you saying that a file is created, but has no contents (zero length)?
 
mike statham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's correct......The file is there with nothing in side......
 
Ron McLeod
Saloon Keeper
Posts: 1814
238
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried the first bit of your code and it ran fine (except for out being out of scope when you tried to close() it) - file was created and contained verbose time.

Are you sure you are looking at the correct file? Check the file's timestamp to be sure it is actually the one being created/updated.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!