git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Clean up sha1 file writing

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 2, 2006, 21:17 UTC
Message-ID
<Pine.LNX.4.64.0606021416040.5498@g5.osdl.org>
In-Reply-To
<44808710.1080000@zytor.com>
On Fri, 2 Jun 2006, H. Peter Anvin wrote:
Show 8 quoted lines
> Linus Torvalds wrote:
> > 
> > Any POSIX-conformant OS/filesystem should always do a full write for a
> > regular file, unless a serious error happens.
> > 
> 
> Actually, at least Linux won't, if the object is larger than 2 GB on a 64-bit
> system :)
Yeah, true.

In the end, you should always have the loop. That way, you never have to worry about what kind of file descriptor it is, what kind of filesystem you're running on, and what the limits of ssize_t might be.

		Linus
Previous: H. Peter AnvinNext: H. Peter Anvin
Message 5 of 15 in “Clean up sha1 file writing”
  1. Linus TorvaldsMay 24, 2006
  2. Matthias LederhoferMay 24, 2006
  3. Linus TorvaldsMay 24, 2006
  4. H. Peter AnvinJun 2, 2006
  5. Linus TorvaldsJun 2, 2006
  6. H. Peter AnvinJun 4, 2006
  7. Linus TorvaldsJun 4, 2006
  8. Linus TorvaldsJun 4, 2006
  9. H. Peter AnvinJun 4, 2006
  10. Junio C HamanoMay 24, 2006
  11. Linus TorvaldsMay 24, 2006
  12. Junio C HamanoMay 25, 2006
  13. SeanMay 25, 2006
  14. Junio C HamanoMay 26, 2006
  15. cat-file: document -p optionJeff King, May 25, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.