mozilla
Your Search Results

    modDateChanged

    Summary

    Returns whether file has been modified since a certain date.

    Method of

    File object

    Syntax

    boolean modDateChanged (FileSpecObject aSourceFolder, Number anOldDate);
    

    Parameters

    The modDateChanged method has the following parameters:

    aSourceFolder
    A FileSpecObject representing the file to be queried.
    anOldDate
    A double representing the date.

    Returns

    A boolean value indicating whether the file has been modified since the input date or has not.

    Description

    Most often, the date passed in as the second parameter in modDateChanged is the returned value from a modDate on a separate file, as in the following example, in which the dates of two files are compared.

    Example

    fileSource1 = getFolder("Program", "file1.txt");
    fileSource2 = getFolder("Program", "file2.txt");
    err1 = File.modDate(fileSource1);    // the baseline returned
    
    err2 = File.modDateChanged(fileSource1, err1);
    logComment("File.modDateChanged should return 'false' = " + err2);
    // the reason it expects false is we're comparing
    // the return 'time stamp' value for
    // file1.txt with the actual file1.txt itself.
    // Thus, no change in 'time stamp' values.
    
    err3 = File.modDateChanged(fileSource2, err1);
    logComment("File.modDateChanged should return 'true' = " + err2);
    // the reason it expects true is we're comparing
    // the return 'time stamp' value  for
    // file1.txt with another file, file2.txt, with a different
    // 'time stamp' value.

    Document Tags and Contributors

    Contributors to this page: Sheppy, Fredchat, ethertank, trevorh, Rod Whiteley
    Last updated by: Sheppy,
    Hide Sidebar