I have some big, big files that I work with and I use several different I/O functions to access them. The most common one is the bigmemory
package.
When writing to the files, I've learned the hard way to flush output buffers, otherwise all bets are off on whether the data was saved. However, this can lead to some very long wait times while bigmemory
does its thing (many minutes). I don't know why this happens - it doesn't always occur and it's not easily reproduced.
Is there some way to determine whether or not I/O buffers have been flushed in R, especially for bigmemory
? If the operating system matters, then feel free to constrain the answer in that way.
If an answer can be generalized beyond bigmemory
, that would be great, as I sometimes rely on other memory mapping functions or I/O streams.
If there are no good solutions to checking whether buffers have been flushed, are there cases in which it can be assumed that buffers have been flushed? I.e. besides using flush()
.
Update: I should clarify that these are all binary connections. @RichieCotton noted that isIncomplete()
, though the help documentation only mentions text connections. It's not clear if that is usable for binary connections.