Initial basic work.
Next to import Alepha and other stuff.
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
CXXFLAGS+= -std=c++23 -O3
|
||||||
|
|
||||||
|
CPPFLAGS+= -I /usr/local/include
|
||||||
|
CPPFLAGS+= -I.
|
||||||
|
|
||||||
|
LDFLAGS+= -Wl,-rpath,'$$ORIGIN/'
|
||||||
|
|
||||||
|
all: cudir
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user