chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] file=? function to compare two files


From: Michele La Monaca
Subject: [Chicken-hackers] [PATCH] file=? function to compare two files
Date: Fri, 25 Jan 2013 17:22:08 +0100

I wasn't able to spot this kind of function in the library so I wrote it
myself. Not sure if files.scm is the right place for that. Not sure either
if inode-numbers equality in Windows is enough to state that two files are
actually the same file. Some tuning might be needed, not yet very
fluent/knowledgeable in scheme... unfortunately.


[procedure] (file=? FILE1 FILE2 #!optional FORCE-COMPARISON)


Examples:

#;1> (file=? "test_A.iso" "test_A.iso")     -->  just inode equality test
#t

#;2> (file=? "test_A.iso" "test_A.iso" #t)  -->  byte-by-byte comparison
#t


Good exercise to learn scheme. Enjoyed!

Regards,
mikele

Attachment: 0001-files.scm-file-equality-function-added.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]