ios_utils.m 483 B

12345678910111213141516171819
  1. /*
  2. * Copyright 2017 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #import <Foundation/Foundation.h>
  8. #include "tools/ios_utils.h"
  9. #include <unistd.h>
  10. void cd_Documents() {
  11. @autoreleasepool {
  12. NSURL* dir = [[[NSFileManager defaultManager]
  13. URLsForDirectory:NSDocumentDirectory
  14. inDomains:NSUserDomainMask] lastObject];
  15. chdir([dir.path UTF8String]);
  16. }
  17. }