阅读背景:

如果我需要行数并且需要附加到文件,我可以避免两次处理文件吗?

来源:互联网 

I am writing a file to disk in stages. As I write it I need to know the line numbers that I am writing to use to build an index. The file now has 12 million lines so I need to build the index on the fly. I am doing this in four steps, with four groupings of the value that I am indexing on. Based on some examples I found elsewhere on SO I decided that to keep my functions as clean as possible I would get the linesize of the file before I start writing so I can use that count to continue to build my index.I am writing a file to disk in stages. As I wri




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: