Invalid argument exception when trying to seek FilePosition to LONG.MAX_VALUE
Karan Mehta
k.mehta at salesforce.com
Thu Jun 6 18:24:09 UTC 2019
> I don't think this make sense. The position(long) method is specified to
throw IOException when it fails so I'm wondering what you expect the
file position to be if it silently fails?
In hindsight, I realize that your suggestion seems right. By a quick
search, I didn't find a way of figuring the underlying file system in Java
or not, so I guess IOException handling is the way to go.
The application should determine this appropriately then. I hope we can
update the javadoc here
<https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#position(long)>
to
reflect that things can change based on underlying FS.
Thanks Alan and Florian for the help.
On Thu, Jun 6, 2019 at 7:22 AM Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
>
> On 05/06/2019 18:06, Karan Mehta wrote:
> > :
> >
> > Let me clarify this a bit further. If the underlying FS throws an
> > exception while seeking to LONG.MAX_VALUE, the JNI call should catch
> > it and return a No-op to the Java function, instead of throwing it
> > back further.
> I don't think this make sense. The position(long) method is specified to
> throw IOException when it fails so I'm wondering what you expect the
> file position to be if it silently fails?
>
>
> >
> > > This is with ext4, right? XFS is fine with it and can even write
> there:
> >
> > Can't speak for XFS, but yeah with ext4 is where I am seeing the issue.
> >
> Thanks Florian for the additional information on this.
>
> -Alan.
>
--
Karan Mehta
<http://smart.salesforce.com/sig/k.mehta//us_mb/default/link.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190606/ed649b8f/attachment.html>
More information about the nio-dev
mailing list