* Added: fortran_bin_file.peek_next_rec_len() to fetch the next record length
while not advancing the read pointer to that record yet.
This commit is contained in:
@@ -220,6 +220,15 @@ class fortran_bin_file(object):
|
||||
|
||||
self.write_vals(*vals, **opts)
|
||||
|
||||
def peek_next_rec_len(self):
|
||||
"""Fetches the length of the next record, while preserving
|
||||
the position of the file read pointer.
|
||||
"""
|
||||
filepos = self.F.tell()
|
||||
reclen = numpy.fromfile(self.F, self.record_marker_type, 1)
|
||||
self.F.seek(filepos)
|
||||
return reclen[0]
|
||||
|
||||
|
||||
def array_major_dim(arr):
|
||||
"""Tests whether a numpy array is column or row major.
|
||||
|
||||
Reference in New Issue
Block a user