Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
Error performing inpage operation
Simon Good
Ranch Hand
Posts: 30
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why do I get this error
java.io.IOException: Error performing inpage operation
when I try to copy a file from a server to my local disk?
I'm using nio FileChannels
Someone help - please!
David Harkness
Ranch Hand
Posts: 1646
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Got code?
Simon Good
Ranch Hand
Posts: 30
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yep, here ya go........
private boolean doCopy(File origin, File dest) { boolean success = true; FileChannel srcChannel = null; FileChannel dstChannel = null; try { srcChannel = new FileInputStream(origin.getAbsolutePath()).getChannel(); dstChannel = new FileOutputStream(dest.getAbsolutePath()).getChannel(); srcChannel.transferTo(0, srcChannel.size(), dstChannel); } catch(Exception e) { success = false; log.error("doCopy Failed to copy " + origin.getAbsolutePath() + " to " + dest.getAbsolutePath(), e); } AudioController.releaseLockAndChannel(null, srcChannel); AudioController.releaseLockAndChannel(null, dstChannel); log.debug("doCopy returns : " + success); return success; }
Simon Good
Ranch Hand
Posts: 30
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Worked it out
I already have a FileChannel open on the source file somewhere else in the code. Bit of a misleading message in the exception though.
Cheers
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
fundamentals..
Can one thread halt another thread?
Thread safe J2ee applcaition
Where to write CleanUp Code ?
exception: java.lang.NullPointer Exception
More...