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
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
forum!
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
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
I/O and Streams
Error performing inpage operation
Simon Good
Ranch Hand
Posts: 30
posted 20 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 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Got code?
Simon Good
Ranch Hand
Posts: 30
posted 20 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 20 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
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
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...