RosettaCodeData/Task/File-size/Clean/file-size.clean

13 lines
352 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
import StdEnv
fileSize fileName world
# (ok, file, world) = fopen fileName FReadData world
| not ok = abort "Cannot open file"
# (ok, file) = fseek file 0 FSeekEnd
| not ok = abort "Cannot seek file"
# (size, file) = fposition file
(_, world) = fclose file world
= (size, world)
Start world = fileSize "input.txt" world