Handbook
Glossary
source-modified? ( path -- ? )
Vocabulary
vocabs
.
refresh
Inputs
path
a pathname string
Outputs
?
a
boolean
Word description
Tests if the source file has been modified since it was last loaded. This compares the file's CRC32 checksum of the file's contents against the previously-recorded value.
Definition
USING:
accessors
assocs
checksums
checksums.crc32
io.encodings.utf8
io.files
kernel
namespaces
source-files
;
IN:
vocabs.refresh
:
source-modified?
( path -- ? )
[
source-files
get
at
]
[
dup
path>>
dup
file-exists?
[
utf8
file-lines
crc32
checksum-lines
swap
checksum>>
=
not
]
[
2drop
f
]
if
]
[
file-exists?
]
?if
;