DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Which File Is Newer?

01.22.2006
| 1452 views |
  • submit to reddit
        
    newer?: func [
        {Returns true if target-1 was modified more recently than target-2;
        false otherwise.}
        target-1 [file! url!]
        target-2 [file! url!]
    ][
        if not exists? target-1 [return false]
        either any [
            all [
                (not none? modified? target-1)
                (none? modified? target-2)
            ]
            (greater? modified? target-1 modified? target-2)
        ] [true] [false]
    ]