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

Re: BUG: fast-import, ftruncate, and file mode

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2022, 23:18 UTC
Message-ID
<xmqqo82xp3ye.fsf@gitster.g>
In-Reply-To
<CABPp-BF_ygATPVGfSR24URm5ZTHBJwJd0miMtgMgNWfw_o33Nw@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 5 quoted lines
>> Am I missing something or is this really a file system bug? Surely if we
>> have opened a file for writing the file permissions when we call
>> ftruncate() should be irrelevant?
>> ...
> Oh, indeed, looks like I can't read late at night.  Sorry for the noise.
Was wondering the same thing.

We open for writing, write one object at a time and when we realize we do not have to, we rewind that stream we are writing into using ftruncate(). It would be a serious problem if we cannot do that.

Previous: Elijah Newren
Message 4 of 4 in “BUG: fast-import, ftruncate, and file mode”
  1. Elijah NewrenFeb 23, 2022
  2. Phillip WoodFeb 23, 2022
  3. Elijah NewrenFeb 23, 2022
  4. Junio C HamanoFeb 23, 2022

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.