libsaria: Get the path to the pipe file
This will either return the full path to the file or an empty string if no pipe has been created.
This commit is contained in:
parent
e1c527c6e7
commit
82b9974448
|
@ -19,5 +19,6 @@ string get_saria_dir();
|
|||
void make_saria_dir();
|
||||
bool exists(string);
|
||||
sid_t lookup_songid(string &);
|
||||
string get_pipe_file();
|
||||
|
||||
#endif /* LIBSARIA_PATH_H */
|
||||
|
|
|
@ -62,3 +62,13 @@ sid_t lookup_songid(string &filepath)
|
|||
return err;
|
||||
return stat.st_ino;
|
||||
}
|
||||
|
||||
string get_pipe_file()
|
||||
{
|
||||
struct stat stat;
|
||||
string file = get_saria_dir() + "/saria.pipe";
|
||||
|
||||
if (lstat(file.c_str(), &stat) != 0)
|
||||
return "";
|
||||
return file;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue