custom open for binary files