This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes How to recognize whether being copy record completed or Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to recognize whether being copy record completed or" Watch "How to recognize whether being copy record completed or" New topic
Author

How to recognize whether being copy record completed or

Eung maeng
Ranch Hand

Joined: Feb 10, 2002
Posts: 68
Does anyone have a solution how to recognize whether file is completed to copy all records?

when being copy a big size file into the folder, other java application need to move other folder only after copying completed.
However, middile of being copy, other java application can move to other folder even has not been finished yet.

File class does not have a relevant method like canWrite() canRead() etc for recognize of complete.

Thus, I used lastModified to check a time and delay for a minute.
which is not good solution becuase even small size file need to wait a certern min to move other folder.

welcome any suggestion,

thanks,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

"Eung JM", please check your private messages for an important administrative matter.
[ July 31, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Carey Evans
Ranch Hand

Joined: May 27, 2008
Posts: 225

There's no good, cross-platform way to do what you want. The best option is to write to a temporary file then rename that to the final file name.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to recognize whether being copy record completed or
 
Similar Threads
How to deploy a GUI Swing application?
Mac OS X > Copying JavaApplicationStub using Java code
Exceptation in thread "main" java.lang.NoSuchMethodError: main
File Renaming while getting copied.
JFileChooser + FileView = bad performance with Thumbnails