Welcome to mirror list, hosted at ThFree Co, Russian Federation.

determine_legal_filenames.cpp « example « attic - github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 667b3f36cc305f0003c296a67b272a0dbbe79db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "afio_pch.hpp"

int main(void)
{
  using namespace boost::afio;
  auto dispatcher=boost::afio::make_dispatcher().get();
        
  auto mkdir(dispatcher->dir(path_req("testdir", file_flags::create)));
  try
  {
    for(size_t n=1; n<256; n++)
    {
      char cs[2]={ (char) n, 0 };
      path p(cs);
      try
      {
        auto mkfile(dispatcher->file(path_req::relative(mkdir, p, boost::afio::file_flags::create)));
        mkfile.get();
        auto rmfile(dispatcher->close(dispatcher->rmfile(mkfile)));
        std::cout << "Character " << n << " (" << p << ") is permitted on this operating system." << std::endl;
      }
      catch(...)
      {
        std::cout << "Character " << n << " (" << p << ") failed on this operating system." << std::endl;
      }
    }
  }
  catch(...)
  {
      std::cerr << boost::current_exception_diagnostic_information(true) << std::endl;
      throw;
  }
  auto rmdir(dispatcher->close(dispatcher->rmdir(mkdir)));
  rmdir.get();
}