SOL9 Sample: Directory

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * Directory.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */



#include <sol\Directory.h>

class TestDirectory {

public:
  void make(const TCHAR* dir) {

  Directory directory;

  if (GetFileAttributes(dir) != 0xffffffff) {
    _tprintf(_T("Already exists %s\n"), dir);
    return;
  }

  try {

    BOOL rc = directory.make(dir, NULL);
    if (rc) {
      _tprintf(_T("Created a new dir= [%s]\n"), dir);
    } else {
      _tprintf(_T("Failed to created a new dir= [%s]\n"), dir);

    }

  } catch (Exception& ex) {
    ex.display();
  } catch (...) {

  }
}
};

void _tmain(int argc, TCHAR* argv[])
{
  TestDirectory tester;


  tester.make(_T("C:\\TEST\\BB"));
  tester.make(_T("C:\\TEST\\BB\\C  C\\DD DD DD\\1234567890 ABCDEFGHIJILM"));

  tester.make(_T("C:\\TEST\\!#$%&'()=~[]"));

  tester.make(_T("C:\\TEST\\<>?_{}`+-|"));
  tester.make(_T("Z:\\TEST\\A\\BB\\CCC"));

  tester.make(_T("C:\\TEST\\•\Ž¦\\AA\\BB\\CC\\•\Ž¦\\DD"));

}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.