16

Duplicate of: Is there an upper limit on .txt file size?


What is the limit to how much you can write to a text file? Any help would be appreciated.

Community
  • 1
  • 1
  • 1
    Dupe of: http://stackoverflow.com/questions/391794/is-there-an-upper-limit-on-txt-file-size Can someone with more brownie points close it as a dupe? – Andrew Rollings Dec 26 '08 at 14:50
  • @Andrew - That other question needs a better title. It's not really a duplicate based on my read – Tall Jeff Dec 26 '08 at 14:58
  • I thought that too... However, the fourth(?) answer in that question actually answers this question. – Andrew Rollings Dec 26 '08 at 15:04
  • It's a dup. It didn't *need* to be - if Rick wanted to add some information on where such limits might come from (platform, filesystem, encoding) then it could easily be made to stand on its own... but he didn't, and as it stands it is merely a less-detailed dup of the previous question. – Shog9 Dec 26 '08 at 15:15

1 Answers1

30

There is no limit, other than the size of your disk, and your file system limitations on a file.

For example, file size limits:

  • NTFS: 16 TiB - 64 KiB
  • Ext4: 16 TBs
  • FAT32: 4GB - 1

On disk, there is no difference between a text file and any other type of file. They all just store bytes of data.

The only conceptual difference when writing to a binary file and a text file is that when a write operation is performed on a text file, a \n character may be replaced with a \r\n character, or some other line ending character(s).

Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
  • 3
    Actually, according to Microsoft knowledge base article (http://technet.microsoft.com/en-us/library/cc781134.aspx) the file size limit for a single file in NTFS is 2^44 bytes - 64K – Tall Jeff Dec 26 '08 at 14:54
  • 2
    @TallJeff the docs say: Maximum file size: 16 terabytes minus 64 KB (244 bytes minus 64 KB) – Zilvinas Jul 20 '20 at 19:12