fix a filebox error under Linux
fixed by buckyeh
This commit is contained in:
parent
cf99551924
commit
001eac9dbf
@ -498,24 +498,26 @@ namespace nana
|
|||||||
if(name.empty() || (name.front() == '.'))
|
if(name.empty() || (name.front() == '.'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
auto fpath = i->path().native();
|
||||||
|
auto fattr = fs::status(fpath);
|
||||||
|
|
||||||
item_fs m;
|
item_fs m;
|
||||||
m.name = name;
|
m.name = name;
|
||||||
|
m.directory = fs::is_directory(fattr);
|
||||||
|
|
||||||
auto fattr = fs::status(path + m.name);
|
switch(fattr.type())
|
||||||
|
|
||||||
if(fattr.type() != fs::file_type::not_found && fattr.type() != fs::file_type::unknown)
|
|
||||||
{
|
|
||||||
m.bytes = fs::file_size(path + m.name);
|
|
||||||
m.directory = fs::is_directory(fattr);
|
|
||||||
fs_ext::modified_file_time(path + m.name, m.modified_time);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
case fs::file_type::not_found:
|
||||||
|
case fs::file_type::unknown:
|
||||||
|
case fs::file_type::directory:
|
||||||
m.bytes = 0;
|
m.bytes = 0;
|
||||||
m.directory = fs::is_directory(*i);
|
break;
|
||||||
fs_ext::modified_file_time(path + i->path().filename().native(), m.modified_time);
|
default:
|
||||||
|
m.bytes = fs::file_size(fpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs_ext::modified_file_time(fpath, m.modified_time);
|
||||||
|
|
||||||
file_container_.push_back(m);
|
file_container_.push_back(m);
|
||||||
|
|
||||||
if(m.directory)
|
if(m.directory)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user