Lines Matching refs:_file
595 self._file = f
643 _lock_file(self._file)
649 _unlock_file(self._file)
658 _sync_flush(self._file)
669 self._file.seek(0, 2)
670 cur_len = self._file.tell()
682 self._file.seek(start)
686 buffer = self._file.read(min(4096,
687 stop - self._file.tell()))
700 self._file.close()
709 self._file = open(self._path, 'rb+')
714 _lock_file(self._file, dotlock=False)
737 self._file.close() # Sync has been done by self.flush() above.
751 self._file.seek(0, 2)
752 before = self._file.tell()
758 self._pre_mailbox_hook(self._file)
760 self._pre_message_hook(self._file)
762 self._post_message_hook(self._file)
764 self._file.truncate(before)
766 self._file.flush()
767 self._file_length = self._file.tell() # Record current length of mailbox
780 self._file.seek(start)
781 from_line = self._file.readline().replace(linesep, b'')
782 string = self._file.read(stop - self._file.tell())
795 self._file.seek(start)
797 self._file.readline()
798 string = self._file.read(stop - self._file.tell())
804 self._file.seek(start)
806 self._file.readline()
807 return _PartialFile(self._file, self._file.tell(), stop)
831 start = self._file.tell()
832 self._file.write(from_line + linesep)
833 self._dump_message(message, self._file, self._mangle_from_)
834 stop = self._file.tell()
860 self._file.seek(0)
862 line_pos = self._file.tell()
863 line = self._file.readline()
887 self._file_length = self._file.tell()
909 self._file.seek(0)
913 line = self._file.readline()
914 next_pos = self._file.tell()
919 line = self._file.readline()
920 next_pos = self._file.tell()
931 self._file.seek(0, 2)
932 self._file_length = self._file.tell()
1095 self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
1096 _lock_file(self._file)
1102 _unlock_file(self._file)
1103 _sync_close(self._file)
1104 del self._file
1273 self._file.seek(start)
1274 self._file.readline() # Skip b'1,' line specifying labels.
1277 line = self._file.readline()
1283 line = self._file.readline()
1288 n = stop - self._file.tell()
1290 body = self._file.read(n)
1301 self._file.seek(start)
1302 self._file.readline() # Skip b'1,' line specifying labels.
1305 line = self._file.readline()
1310 line = self._file.readline()
1314 n = stop - self._file.tell()
1316 data = self._file.read(n)
1336 self._file.seek(0)
1341 line = self._file.readline()
1342 next_pos = self._file.tell()
1348 in self._file.readline()[1:].split(b',')
1360 self._file.seek(0, 2)
1361 self._file_length = self._file.tell()
1383 start = self._file.tell()
1392 self._file.write(b'1')
1394 self._file.write(b', ' + label.encode())
1395 self._file.write(b',,')
1397 self._file.write(b' ' + label.encode() + b',')
1398 self._file.write(linesep)
1400 self._file.write(b'1,,' + linesep)
1408 self._file.write(line.replace(b'\n', linesep))
1411 self._file.write(b'*** EOOH ***' + linesep)
1418 self._file.write(line.replace(b'\n', linesep))
1425 self._file.write(line.replace(b'\n', linesep))
1432 self._file.write(buffer.replace(b'\n', linesep))
1442 self._file.write(message[:body_start].replace(b'\n', linesep))
1443 self._file.write(b'*** EOOH ***' + linesep)
1444 self._file.write(message[:body_start].replace(b'\n', linesep))
1445 self._file.write(message[body_start:].replace(b'\n', linesep))
1447 self._file.write(b'*** EOOH ***' + linesep + linesep)
1448 self._file.write(message.replace(b'\n', linesep))
1463 self._file.write(line.replace(b'\n', linesep))
1467 self._file.write(b'*** EOOH ***' + linesep)
1482 self._file.write(line)
1485 stop = self._file.tell()
1928 self._file = f
1936 return self._read(size, self._file.read)
1940 return self._read(size, self._file.read1)
1944 return self._read(size, self._file.readline)
1972 self._file.seek(self._pos)
1973 self._file.seek(offset, whence)
1974 self._pos = self._file.tell()
1980 if hasattr(self._file, 'close'):
1981 self._file.close()
1983 del self._file
1989 self._file.seek(self._pos)
1991 self._pos = self._file.tell()
2002 return self._file.readable()
2005 return self._file.writable()
2008 return self._file.seekable()
2011 return self._file.flush()
2017 if not hasattr(self._file, 'closed'):
2019 return self._file.closed
2060 del self._file