Why should text files end with a newline?

后端 未结 18 1237
栀梦
栀梦 2020-11-21 22:56

I assume everyone here is familiar with the adage that all text files should end with a newline. I\'ve known of this \"rule\" for years but I\'ve always wondered — why?

18条回答
  •  忘了有多久
    2020-11-21 23:20

    Imagine that the file is being processed while the file is still being generated by another process.

    It might have to do with that? A flag that indicates that the file is ready to be processed.

提交回复
热议问题