mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-08-24 11:25:53 -05:00
Ignore dot (.) files
When reading the drive config ignore all files starting with a .
This commit is contained in:
@@ -37,7 +37,7 @@ namespace fs
|
||||
{
|
||||
public:
|
||||
dirList() = default;
|
||||
dirList(const std::string& _path);
|
||||
dirList(const std::string& _path, bool ignoreDotFiles = false);
|
||||
void reassign(const std::string& _path);
|
||||
void rescan();
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ static void loadTitleDefs()
|
||||
|
||||
static void loadDriveConfig()
|
||||
{
|
||||
fs::dirList cfgList("/config/JKSV/");
|
||||
fs::dirList cfgList("/config/JKSV/", true);
|
||||
|
||||
std::string clientSecretPath;
|
||||
for(unsigned i = 0; i < cfgList.getCount(); i++)
|
||||
|
||||
@@ -220,7 +220,7 @@ std::string fs::dirItem::getExt() const
|
||||
return util::getExtensionFromString(itm);
|
||||
}
|
||||
|
||||
fs::dirList::dirList(const std::string& _path)
|
||||
fs::dirList::dirList(const std::string& _path, bool ignoreDotFiles)
|
||||
{
|
||||
DIR *d;
|
||||
struct dirent *ent;
|
||||
@@ -228,7 +228,8 @@ fs::dirList::dirList(const std::string& _path)
|
||||
d = opendir(path.c_str());
|
||||
|
||||
while((ent = readdir(d)))
|
||||
item.emplace_back(path, ent->d_name);
|
||||
if (!ignoreDotFiles || ent->d_name[0] != '.')
|
||||
item.emplace_back(path, ent->d_name);
|
||||
|
||||
closedir(d);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user