Re: need a better file copy method - SOLVED?

2006-05-04 Thread Jim C.
OK, here is what seems to be working. I did some reading and noticed that closing the output stream was an op that was pretty close to the hardware. So, when cleaning up, do the following: fileOutStream.flush(); srcChannel.close ( ) ; dstChannel.close ( ) ; fileOutStream.close(); Anyway,

Re: need a better file copy method

2006-05-03 Thread Ioan - Ciprian Tandau
On 5/3/06, Stefaan A Eeckels <[EMAIL PROTECTED]> wrote: On Wed, 3 May 2006 07:32:10 -0400 "Ioan - Ciprian Tandau" <[EMAIL PROTECTED]> wrote: > I told him about getFD().sync() (for FileInput/OutputStream and > RandomFile It seems to be the only way to make sure things are > synchronously writ

Re: need a better file copy method

2006-05-03 Thread Stefaan A Eeckels
On Wed, 3 May 2006 07:32:10 -0400 "Ioan - Ciprian Tandau" <[EMAIL PROTECTED]> wrote: > I told him about getFD().sync() (for FileInput/OutputStream and > RandomFile It seems to be the only way to make sure things are > synchronously written to disk (local storage). The fact that the file is ph

Re: need a better file copy method

2006-05-03 Thread Ioan - Ciprian Tandau
I told him about getFD().sync() (for FileInput/OutputStream and RandomFile It seems to be the only way to make sure things are synchronously written to disk (local storage). On 5/3/06, Stefaan A Eeckels <[EMAIL PROTECTED]> wrote: On Tue, 02 May 2006 14:38:50 -0700 "Jim C." <[EMAIL PROTECTED]

Re: need a better file copy method

2006-05-03 Thread Stefaan A Eeckels
On Tue, 02 May 2006 14:38:50 -0700 "Jim C." <[EMAIL PROTECTED]> wrote: > Stefaan A Eeckels wrote: > > On Mon, 01 May 2006 13:41:12 -0700 > > "Jim C." <[EMAIL PROTECTED]> wrote: > > > >> Anyone know how a simple file copy can be accomplished in an > >> explicitly synchronous manner without adding

Re: need a better file copy method

2006-05-02 Thread Stefaan A Eeckels
On Mon, 01 May 2006 13:41:12 -0700 "Jim C." <[EMAIL PROTECTED]> wrote: > Anyone know how a simple file copy can be accomplished in an > explicitly synchronous manner without adding Thread.sleep(n) after > calling flush on the output stream? Have you tried the streams method from the same site: h

need a better file copy method

2006-05-01 Thread Jim C.
OK, so I need to do a simple file copy for a unit test. I found a great code example here: http://tinyurl.com/kkhju Problem is: My test will fail roughly 50% of the time because the test's data file is not finished copying. I've done everything I can imagine to accomplish this in a synchro