Entering edit mode
I think that the Rsamtools::FaFile function should check whether it got a proper file to read. If it unwittingly is given a directory name, nothing happens, but the whole R session crashes when you subsequently pass the object to an open() call . To reproduce, simply try this:
library(Rsamtools) open(FaFile("."))
This is the latest Rsamtools, v. 1.22.0
Philip