Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
filesystem.cc
Go to the documentation of this file.
1
// ======================================================================
2
//
3
// filesystem: A family of file-level utilities
4
//
5
// ======================================================================
6
7
#include "
cetlib/filesystem.h
"
8
9
#include <sys/stat.h>
10
11
// ----------------------------------------------------------------------
12
13
bool
14
cet::file_exists
(
std::string
const
& qualified_filename)
15
{
16
struct
stat
file_info;
17
return
0 ==
stat
(qualified_filename.c_str(), &file_info);
18
}
19
20
// ----------------------------------------------------------------------
21
22
bool
23
cet::is_absolute_filepath
(
std::string
const
& qualified_filename)
24
{
25
return
qualified_filename[0] ==
'/'
;
26
}
27
28
bool
29
cet::is_relative_filepath
(
std::string
const
& qualified_filename)
30
{
31
return
!
is_absolute_filepath
(qualified_filename);
32
}
33
34
// ======================================================================
string
std::string string
Definition:
nybbler.cc:12
python.larbatch_posix.stat
def stat(path)
Definition:
larbatch_posix.py:482
cet::is_relative_filepath
bool is_relative_filepath(std::string const &qualified_filename)
Definition:
filesystem.cc:29
filesystem.h
cet::is_absolute_filepath
bool is_absolute_filepath(std::string const &qualified_filename)
Definition:
filesystem.cc:23
cet::file_exists
bool file_exists(std::string const &qualified_filename)
Definition:
filesystem.cc:14
Generated by
1.8.11