def read_bin(self):
try:
with open(self.filepath, 'rb') as bin_reader:
data = bin_reader.read()
return data
except Exception as e:
if DEBUG_FLAG:
sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).")
raise e
#------------------------------------------------------------------------------
# [ read_as method ] (string with developer specified text encoding)
# Text file reader with developer specified text encoding
# returns file contents in developer specified text encoding
# Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file
#------------------------------------------------------------------------------
评论列表
文章目录