Subversion Repositories tpanel

Rev

Rev 156 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 186
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020, 2021 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020 to 2022 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 51... Line 51...
51
    DECL_TRACER("TValidateFile::isValidFile(const string& file)");
51
    DECL_TRACER("TValidateFile::isValidFile(const string& file)");
52
 
52
 
53
    struct stat buffer;
53
    struct stat buffer;
54
 
54
 
55
    if (stat (file.c_str(), &buffer) != 0)
55
    if (stat (file.c_str(), &buffer) != 0)
56
    {
-
 
57
        MSG_WARNING("File access error (" << file << "): " << strerror(errno));
-
 
58
        return false;
56
        return false;
59
    }
-
 
60
 
57
 
61
    if ((buffer.st_mode & S_IFREG) > 0)
58
    if ((buffer.st_mode & S_IFREG) > 0)
62
        return true;
59
        return true;
63
 
60
 
64
    return false;
61
    return false;