Lines Matching refs:_file
592 self._file = f
640 _lock_file(self._file)
646 _unlock_file(self._file)
655 _sync_flush(self._file)
666 self._file.seek(0, 2)
667 cur_len = self._file.tell()
679 self._file.seek(start)
683 buffer = self._file.read(min(4096,
684 stop - self._file.tell()))
697 self._file.close()
706 self._file = open(self._path, 'rb+')
711 _lock_file(self._file, dotlock=False)
734 self._file.close() # Sync has been done by self.flush() above.
748 self._file.seek(0, 2)
749 before = self._file.tell()
755 self._pre_mailbox_hook(self._file)
757 self._pre_message_hook(self._file)
759 self._post_message_hook(self._file)
761 self._file.truncate(before)
763 self._file.flush()
764 self._file_length = self._file.tell() # Record current length of mailbox
777 self._file.seek(start)
778 from_line = self._file.readline().replace(linesep, b'')
779 string = self._file.read(stop - self._file.tell())
792 self._file.seek(start)
794 self._file.readline()
795 string = self._file.read(stop - self._file.tell())
801 self._file.seek(start)
803 self._file.readline()
804 return _PartialFile(self._file, self._file.tell(), stop)
828 start = self._file.tell()
829 self._file.write(from_line + linesep)
830 self._dump_message(message, self._file, self._mangle_from_)
831 stop = self._file.tell()
857 self._file.seek(0)
859 line_pos = self._file.tell()
860 line = self._file.readline()
884 self._file_length = self._file.tell()
906 self._file.seek(0)
910 line = self._file.readline()
911 next_pos = self._file.tell()
916 line = self._file.readline()
917 next_pos = self._file.tell()
928 self._file.seek(0, 2)
929 self._file_length = self._file.tell()
1092 self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
1093 _lock_file(self._file)
1099 _unlock_file(self._file)
1100 _sync_close(self._file)
1101 del self._file
1270 self._file.seek(start)
1271 self._file.readline() # Skip b'1,' line specifying labels.
1274 line = self._file.readline()
1280 line = self._file.readline()
1285 n = stop - self._file.tell()
1287 body = self._file.read(n)
1298 self._file.seek(start)
1299 self._file.readline() # Skip b'1,' line specifying labels.
1302 line = self._file.readline()
1307 line = self._file.readline()
1311 n = stop - self._file.tell()
1313 data = self._file.read(n)
1333 self._file.seek(0)
1338 line = self._file.readline()
1339 next_pos = self._file.tell()
1345 in self._file.readline()[1:].split(b',')
1357 self._file.seek(0, 2)
1358 self._file_length = self._file.tell()
1380 start = self._file.tell()
1389 self._file.write(b'1')
1391 self._file.write(b', ' + label.encode())
1392 self._file.write(b',,')
1394 self._file.write(b' ' + label.encode() + b',')
1395 self._file.write(linesep)
1397 self._file.write(b'1,,' + linesep)
1405 self._file.write(line.replace(b'\n', linesep))
1408 self._file.write(b'*** EOOH ***' + linesep)
1415 self._file.write(line.replace(b'\n', linesep))
1422 self._file.write(line.replace(b'\n', linesep))
1429 self._file.write(buffer.replace(b'\n', linesep))
1439 self._file.write(message[:body_start].replace(b'\n', linesep))
1440 self._file.write(b'*** EOOH ***' + linesep)
1441 self._file.write(message[:body_start].replace(b'\n', linesep))
1442 self._file.write(message[body_start:].replace(b'\n', linesep))
1444 self._file.write(b'*** EOOH ***' + linesep + linesep)
1445 self._file.write(message.replace(b'\n', linesep))
1460 self._file.write(line.replace(b'\n', linesep))
1464 self._file.write(b'*** EOOH ***' + linesep)
1479 self._file.write(line)
1482 stop = self._file.tell()
1925 self._file = f
1933 return self._read(size, self._file.read)
1937 return self._read(size, self._file.read1)
1941 return self._read(size, self._file.readline)
1969 self._file.seek(self._pos)
1970 self._file.seek(offset, whence)
1971 self._pos = self._file.tell()
1977 if hasattr(self._file, 'close'):
1978 self._file.close()
1980 del self._file
1986 self._file.seek(self._pos)
1988 self._pos = self._file.tell()
1999 return self._file.readable()
2002 return self._file.writable()
2005 return self._file.seekable()
2008 return self._file.flush()
2014 if not hasattr(self._file, 'closed'):
2016 return self._file.closed
2055 del self._file