Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 3
    Can you explain the perl -e 'truncate STDOUT, tell STDOUT'? It works for me without including that. Any way to achieve the same thing without using Perl? Commented Feb 1, 2016 at 21:57
  • 1
    @AaronBlenkush, see edit. Commented Feb 1, 2016 at 22:12
  • 2
    @nealmcb, see edit. Commented Jul 31, 2017 at 7:05
  • 2
    @akhan, that other approach replaces the file with a new one, it doesn't overwrite the same file in place. In particular, permissions ownership, and other metadata of the original file will be lost. Commented May 8, 2021 at 8:51
  • 2
    @AndréChalella, no we need to open the file a second time so we get two separate open file descriptions that have independant cursors within the file. Commented Jul 31, 2023 at 5:39