mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Fixed zeek::filesystem::path conversion to string
This commit is contained in:
parent
dbaf6696ef
commit
4043b67e0b
2 changed files with 6 additions and 6 deletions
|
@ -88,7 +88,7 @@ struct LeftoverLog
|
||||||
* Return the "path" (logging framework parlance) of the log without the
|
* Return the "path" (logging framework parlance) of the log without the
|
||||||
* directory or file extension. E.g. the "path" of "logs/conn.log" is just "conn".
|
* directory or file extension. E.g. the "path" of "logs/conn.log" is just "conn".
|
||||||
*/
|
*/
|
||||||
std::string Path() const { return zeek::filesystem::path(filename).stem(); }
|
std::string Path() const { return zeek::filesystem::path(filename).stem().string(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the shadow file and returns whether it succeeded.
|
* Deletes the shadow file and returns whether it succeeded.
|
||||||
|
@ -493,7 +493,7 @@ bool Ascii::DoInit(const WriterInfo& info, int num_fields, const threading::Fiel
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( fname.front() != '/' && ! logdir.empty() )
|
if ( fname.front() != '/' && ! logdir.empty() )
|
||||||
fname = zeek::filesystem::path(logdir) / fname;
|
fname = (zeek::filesystem::path(logdir) / fname).string();
|
||||||
|
|
||||||
fname += ext;
|
fname += ext;
|
||||||
|
|
||||||
|
@ -773,7 +773,7 @@ static std::vector<LeftoverLog> find_leftover_logs()
|
||||||
if ( BifConst::LogAscii::logdir->Len() > 0 )
|
if ( BifConst::LogAscii::logdir->Len() > 0 )
|
||||||
logdir = zeek::filesystem::absolute(BifConst::LogAscii::logdir->ToStdString());
|
logdir = zeek::filesystem::absolute(BifConst::LogAscii::logdir->ToStdString());
|
||||||
|
|
||||||
auto d = opendir(logdir.c_str());
|
auto d = opendir(logdir.string().c_str());
|
||||||
struct dirent* dp;
|
struct dirent* dp;
|
||||||
|
|
||||||
if ( ! d )
|
if ( ! d )
|
||||||
|
@ -788,8 +788,8 @@ static std::vector<LeftoverLog> find_leftover_logs()
|
||||||
if ( strncmp(dp->d_name, shadow_file_prefix, prefix_len) != 0 )
|
if ( strncmp(dp->d_name, shadow_file_prefix, prefix_len) != 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::string shadow_fname = logdir / dp->d_name;
|
std::string shadow_fname = (logdir / dp->d_name).string();
|
||||||
std::string log_fname = logdir / (dp->d_name + prefix_len);
|
std::string log_fname = (logdir / (dp->d_name + prefix_len)).string();
|
||||||
|
|
||||||
if ( util::is_file(log_fname) )
|
if ( util::is_file(log_fname) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -147,7 +147,7 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields, const Field* con
|
||||||
tablename = it->second;
|
tablename = it->second;
|
||||||
|
|
||||||
if ( checkError(sqlite3_open_v2(
|
if ( checkError(sqlite3_open_v2(
|
||||||
fullpath.c_str(), &db,
|
fullpath.string().c_str(), &db,
|
||||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL)) )
|
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL)) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue