Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TracyFilesystem.hpp « server - github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 31d64e0e8520f0a6d44f262695a6c6e022f20b5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __TRACYFILESYSTEM_HPP__
#define __TRACYFILESYSTEM_HPP__

#include <sys/stat.h>

namespace tracy
{

static inline bool FileExists( const char* fn )
{
    struct stat buf;
    return stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0;
}

static inline bool SourceFileValid( const char* fn, uint64_t olderThan )
{
    struct stat buf;
    if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
    {
        return buf.st_mtime < olderThan;
    }
    return false;
}

}

#endif