MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / write

Method write

tools/python-3.11.9-amd64/Lib/_pyio.py:1713–1725  ·  view source on GitHub ↗

Write bytes b to file, return number written. Only makes one system call, so not all of the data may be written. The number of bytes actually written is returned. In non-blocking mode, returns None if the write would block.

(self, b)

Source from the content-addressed store, hash-verified

1711 return n
1712
1713 def write(self, b):
1714 """Write bytes b to file, return number written.
1715
1716 Only makes one system call, so not all of the data may be written.
1717 The number of bytes actually written is returned. In non-blocking mode,
1718 returns None if the write would block.
1719 """
1720 self._checkClosed()
1721 self._checkWritable()
1722 try:
1723 return os.write(self._fd, b)
1724 except BlockingIOError:
1725 return None
1726
1727 def seek(self, pos, whence=SEEK_SET):
1728 """Move to new file position.

Callers 5

writelinesMethod · 0.45
_flush_unlockedMethod · 0.45
writeMethod · 0.45
writeMethod · 0.45
writeMethod · 0.45

Calls 2

_checkWritableMethod · 0.95
_checkClosedMethod · 0.45

Tested by

no test coverage detected