ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject unpredictable failure of FileChannel#transferFrom
Date Sat, 04 Jan 2014 15:23:35 GMT
Hi all,

in ResourceUtils#copy we'll use FileChannel#transferFrom if source and
target are Files and we don't need to modify the contents.  It looks as
if transferFrom uses mmap under the covers and sometimes fails to do so
- for example when one file is on a network file system[1] but it looks
as if this was not the only issue[2].

>From the stacktraces in [1] it looks as if all Ant sees is a plain
IOException so we cannot handle the case by falling back to stream based
copying.

One option could be yet another flag to the copy methods together with
an attribute on all tasks that happen to use it - this would give user
maximal control.  Another option may be a system property that users
could set to disable transferFrom in the rare cases where it is causing
problems - which would increase the documentation burden and isn't too
IDE friendly.  Other choices?

Stefan

[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=54397

[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=53102

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message