WasFile  ver. 2.2 (c) 2006-2007, Horst Schaeffer
------------------------------------------------

This program compares ..
        the time&date of two files,
        the date only, time ignored
        the date of a file with TODAY-n (days)
        the time&date of a file with NOW-n (minutes) 

Examples:  
        WasFile this.zip created before that.zip 
        WasFile this.zip modified after today-8 
        WasFile this.dat created before now-10  

Result by errorlevel:
        0: true, 1: false, 255: error (message to STDERR)

Syntax:
        WasFile File1 [Stamp] [not] before|after|sametime File2 [Stamp] [Option] 
        WasFile File1 [Stamp] [not] before|after|sametime today-n [Option] 

File1, file2 may be files or directories with optional path. No wildcards allowed.
Stamp (type) is either:  created, modified (default) or accessed 

Option to compare date only, ignore time: /DateLocal or /DateUTC 

For "today-n" (n: number of days) the option is /DateLocal by default 
For "now-n" (n: number of minutes) date options are ignored 

Notes:
        Case ignored.        
        Arguments must be separated by blank space, however, the expressions 
        "today-n" and "now-n" may be written without spaces. 

        "not before" means: sametime or after
        "not after" means: sametime or before 

        "created" refers to creation of a physical instance of the file;
        "modified" refers to the content (which does not change when a file 
        is copied, for example)

        UTC or local time is only relevant when the date is evaluated
        for comparison. 

Example (BAT or CMD):

        WasFile this.zip created before that.zip
        if not errorlevel 1 goto OK_CONTINUE 
        if errorlevel 255 goto ERROR 
        echo It was NOT created before 
        .....

Debug option /debug

        /debug will display the return code (errorlevel) and the time difference 
        in seconds, i.e. negative difference means "before".

--------
History:

23 Jan 2007 - ver. 2.2 - Error if wildcards; trailing backslash allowed for directories
29 Sep 2006 - ver. 2.1 - Filepaths: case preserved; /debug
10 Jul 2006 - ver. 2.0 - added: Compare with NOW-n (minutes), bugfix DST 
03 Jun 2006 - ver. 1.1 - added feature: Compare with TODAY-n (days)

Copyright, Disclaimer:

This program is distributed as "freeware," copyright reserved by the author.
There are no warranties of any kind, nor any liability by the author. 
Users accept full responsibility for the use they make of the software and
for any damage caused thereby.

Source available: http://home.mnet-online.de/horst.muc/source/wasfile22.zip

mailto:horst.schaeffer@gmx.net
http://home.mnet-online.de/horst.muc/

23 Jan 2007
