Dwi Novitasari
Dwi Novitasari

Reputation: 21

How to create a folder that has a sharing access to "everyone" using c++

I need help on how to add "everyone" to the folder's share option property using c++.

this is my code on how to create new folder

#include <direct.h>
    int main()
    {
          mkdir("c:/scan");
          return 0;
    }

Upvotes: 1

Views: 1182

Answers (1)

eerorika
eerorika

Reputation: 238311

According to the documentation, following should create a directory, and set permissions to give all users access:

namespace fs = std::filesystem;
fs::create_directory(path);
fs::permissions(path, fs::perms::all);

Upvotes: 2

Related Questions