#What is the max_size argument in std.io.Reader.readAllAlloc?

1 messages · Page 1 of 1 (latest)

bold granite
#

I know what it does, but what should my argument be if I'm reading a file and don't know it's maximum size

dense flame
#

If you don't know the length you should use a buffered reader.

prime peak
#

you chose the maximum length that you are ok with reading. if you really don't want any limit you can use maxInt

scenic glen
winter rock
#

you can try to get the file size with

var fsz = (try file.stat()).size;