Reputation: 1668
I have a Java RandomAccessFile
. I check the length of the file frequently. The file is coming from an scp
. Therefore, the file is getting appended.
I want to know how frequently the RandomAccessFile
is updated. Whenever I check RandomAccessFile.length
, will get I the accurate length
?
Upvotes: 1
Views: 428
Reputation: 2710
Since the method is native, I'd recommend taking a look in the OpenJDK source code. It's the closest thing you'll get to the actual implementation (unless you work for Oracle ;-).
The source can be found here (it's shared between all OS): src/share/native/java/io/RandomAccessFile.c
tl;dr
Yes, it will try to find the end of the file descriptor the RandomAccessFile
is referring to.
Upvotes: 2