Is there a word for "truncate to size zero", preferably one which could be used and understood in the following way:

"...ing the file" := "truncating the file to zero bytes"?

RECAP: The best answers so far seem to be "empty the file", "zero the file size" and "truncate to (size|length) zero". In a suitable context, "truncate" has "truncate to (size|length) zero" as the default meaning (esp. since it's the commonest specific length to which files are truncated) but it's by no means the only one

  • 3
    "To truncate" means to cut down, usually assuming, I think, that something is left. Wouldn't "truncating a file to zero bytes" be the same as "deleting the file"?
    – DyingIsFun
    Jan 17, 2016 at 1:06
  • 1
    It isn't. "...ing to size 0" affects only file size (perhaps truncate isn't the right word, ow. I could use it in this meaning already), delete affects its existence
    – jaam
    Jan 17, 2016 at 1:11
  • 1
    @Ricky There are plenty of situations where someone would truncate a file that have nothing to do with temporary files, and where no code was written. A quick google search will show that truncate is frequently used for this purpose.
    – jimm101
    Jan 17, 2016 at 1:43
  • 1
    @Silenus: There is history behind the use of the word "truncate" in this context (do Ctrl+F "truncate"). We can't very well rename O_TRUNC without breaking lots of code.
    – Kevin
    Jan 17, 2016 at 6:00
  • 1
    man fopen uses "Truncate file to zero length" once explicitly and from then on just "truncate" for the same concept, the zero length thus being understood Jan 17, 2016 at 10:34

6 Answers 6


empty the file, could be used. After all, one is left with an empty file.

There is Google evidence of usage for empty the file.

There is also Google evidence of usage for clear the file.


Truncate is the correct word. Truncating a file means to eliminate all the content. The MySQL command for removing a table in database is TRUNCATE, which I present as a related term that clearly indicates the "zero size" aspect.

EDIT: Just to be clear, the "to size zero" is redundant. Truncate means what you want to say here.

  • 7
    You are probably right that "truncate" is the best single word for it (but in general, "truncating a file" means truncating it to a specific length, which may or may not be zero)
    – jaam
    Jan 17, 2016 at 1:49
  • 1
    @jaam - the size defaults to zero if not specified. Jan 17, 2016 at 8:52
  • 5
    @SomethingDark: that’s a default for certain programming languages, but not for English as spoken by most humans. For me, truncate in a programming context certainly can include the case of truncating to length 0, but my default expectation would be a non-zero length. Possibly there are some communities who would use it for 0 by default — I haven’t spent time around SQL professionals, for instance — but in the absence of other evidence, I somewhat doubt it.
    – PLL
    Jan 17, 2016 at 11:53
  • In my experience, truncate to a length triggers more confusion than truncate to zero. Let's remember there's also a specific context here in terms of file length, so general usage in English is secondary at best. Programmers form a community where English is spoken among non-native talkers, so words tend to pick up nuanced meanings that don't always apply outside that domain.
    – jimm101
    Jan 17, 2016 at 20:47

"Zeroing out" the file? Used to specify that a file has been deleted/shredded using an algorithm that sets all bits that were used to store the file to zeroes.

  • 6
    The question is looking for a word for reducing the file's length to zero bytes long, not overwriting the file with bytes of value zero. Also, "zeroing out" the file would generally imply filling it with zero-valued bytes without changing its size or deleting it from the filesystem. Jan 17, 2016 at 2:16

I think that the word diminish could be used to mean reduce absolutely, to nothing.

to become or to cause (something) to become less in size, importance, etc.

Mirriam Webster

So you could say, diminishing the file.

  • 2
    Diminish reduces the size of the file, not necessarily to zero bytes.
    – ab2
    Jan 17, 2016 at 1:52

I think, Truncating can be replaced with " Reducing " as " Reducing to a size zero"

Example: The file should be truncated to size zero or Reduced to a zero size. Both can be used preferably.


Diminishing can also be used but the exact extent should be noted otherwise it will express indistinctly that what amount you want to diminish to.

Example: You should Diminish the cloth to a size zero.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.