Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.1

# FileSys::StatModTime()

Return the last modified time of the file specified by the `path` protected `FileSys` member.

Virtual? | Yes |
Class | `FileSys` |
Arguments | None |
Returns | `int` | 0 for failure, or last modified time in seconds since 00:00:00, January 1, 1970, GMT.

## Notes

The default implementation of `StatModTime()` is called every time a client file is submitted or synced.

## Example

To use `StatModTime()` to obtain the modification time on a log file:

    FileSys *f = FileSys::Create( FST_ATEXT );
    f->Set( "/usr/logs/logfile.txt" );
    int time = f->StatModTime();

    if ( time )
        printf( "%d", time );

To reimplement `StatModTime()` to provide debugging output:

    int FileSysDemo::StatModTime()
    {
        struct stat st;

        if ( stat( Name(), &st ) < 0 )
            return( 0 );

        if ( DEBUG )
            printf( "Debug (StatModTime): %s\n", Name() );

        return (int)( st.st_mtime );
    }

Your search for returned results