1 ;; Test for LFS (Large Files Support)
2 ;; create a file with more than 2^32 bytes
3 ;; and read back some records for verification
4 ;; Needs apprxomately 5 Gigabyte of diskspace
5 ;; writing a file of 5,000,000 records of 1k each.
7 (set 'file (open "largefile" "write"))
10 (set 'rec (append (format "%08d" i) (dup "#" 992)))
11 (write-buffer file rec 1000)
12 (if (= 0 (% i 10000)) (println i " kbytes written"))
16 (set 'file (open "largefile" "read"))
18 (for (i 0 4999999 10000)
19 (set 'test (append (format "%08d" i) (dup "#" 992)))
20 (seek file (mul i 1000))
21 (read-buffer file 'rec 1000)
23 (println i " record -> Ok " (0 8 rec))
24 (println i " record -> Error reading " (0 8 rec)))