#how can i get the size of the contents in a txt file?

1 messages · Page 1 of 1 (latest)

heavy wren
#
const stat = try file.stat();
const size = stat.size;

this is runtime of course, you wont be able to create an array with this

pine pagoda
#

note: this may not work for all files, particularly on linux, where fake files (like those you find in /sys/ and /proc/ report a size of 0)