source: project/release/4/memory-mapped-files/tests/run.scm @ 31138

Last change on this file since 31138 was 31138, checked in by felix winkelmann, 6 years ago

added preliminary eggs for extraction from core libraries

File size: 518 bytes
Line 
1(use memory-mapped-files files posix lolevel)
2
3
4(let ((tnpfilpn (create-temporary-file)))
5  (let ((tmpfilno (file-open tnpfilpn (+ open/rdwr open/creat)))
6        (data "abcde")
7        (size 5))
8    (file-write tmpfilno data)
9    (let ((mmap (map-file-to-memory #f size prot/read (+ map/shared map/file) tmpfilno))
10          (str (make-string size)))
11      (move-memory! (memory-mapped-file-pointer mmap) str size)
12      (assert (blob=? (string->blob data) (string->blob str)))
13      (unmap-file-from-memory mmap))))
Note: See TracBrowser for help on using the repository browser.