Initial basic work.

Next to import Alepha and other stuff.
This commit is contained in:
2026-05-20 02:31:05 -04:00
parent c1b86edf84
commit adec33d6a5
2 changed files with 43 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include <filesystem>
#include <iostream>
std::string
drwx( const std::filesystem::perms p )
{
std::ostringstream oss;
using std::filesystem::perms;
auto show = [&](const char op, const perms perm)
{
oss << (perms::none == (perm bitand p) ? '-' : op);
};
show('r', perms::owner_read);
show('w', perms::owner_write);
show('x', perms::owner_exec);
show('r', perms::group_read);
show('w', perms::group_write);
show('x', perms::group_exec);
show('r', perms::others_read);
show('w', perms::others_write);
show('x', perms::others_exec);
return std::move( oss ).str();
}
int
main()
{
std::filesystem::path where="./";
for( const auto &entry: std::filesystem::directory_iterator{ where } )
{
std::cout << entry.path().string() << " " << drwx( status( entry.path() ).permissions() ) << std::endl;
}
}