Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedoutputStream error  RSS feed

 
Tempora Telora
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Line of Code: BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(dest));

This for some reason throws a file not found exception. Any reasons why?

Thanks,
Randy
 
sven studde
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This for some reason throws a file not found exception. Any reasons why?

There's no such file as dest? By definition, the FileOutputStream constructor overwrites the content of an existing file or if the file cannot be opened for writing (like when the file doesn't exist), it throws an IOException.

[ October 24, 2006: Message edited by: sven studde ]
[ October 24, 2006: Message edited by: sven studde ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be more precise: "dest" represents some file in a directory; that directory doesn't exist.
 
Tempora Telora
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"dest" does exist. As a buff/file input it is fine as buff/file output it throws the filenotfound exception.

Does this mean that the file is already opened somewhere?
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does new File(dest).exists() yield true if you test it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!