mkdirquiet.m 383 B

1234567891011121314151617
  1. function mkdirquiet(x)
  2. % function mkdirquiet(x)
  3. %
  4. % <x> refers to a directory location
  5. %
  6. % make the directory, suppressing warnings
  7. % (e.g. that the directory already exists).
  8. % assert that the result was successful.
  9. %
  10. % example:
  11. % mkdirquiet('temp');
  12. prev = warning('query'); warning('off');
  13. success = mkdir(x);
  14. warning(prev);
  15. assert(success,sprintf('mkdir of %s failed',x));