diff options
Diffstat (limited to 'tools/ios_utils.m')
-rw-r--r-- | tools/ios_utils.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/ios_utils.m b/tools/ios_utils.m new file mode 100644 index 0000000000..b88ab5bfe8 --- /dev/null +++ b/tools/ios_utils.m @@ -0,0 +1,19 @@ +/* + * Copyright 2017 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#import <Foundation/Foundation.h> +#include "ios_utils.h" +#include <unistd.h> + +void cd_Documents() { + @autoreleasepool { + NSURL* dir = [[[NSFileManager defaultManager] + URLsForDirectory:NSDocumentDirectory + inDomains:NSUserDomainMask] lastObject]; + chdir([dir.path UTF8String]); + } +} |