Skip to content

Instantly share code, notes, and snippets.

@Sakurina
Created August 3, 2010 02:21
Show Gist options
  • Save Sakurina/505722 to your computer and use it in GitHub Desktop.
Save Sakurina/505722 to your computer and use it in GitHub Desktop.
file-related helpers for cycript; public-domain
// fileutils - four simple helper functions for Cycript
// this is so silly it should be public domain (so it is)
function mv(old, _new) {
[[NSFileManager defaultManager] moveItemAtPath:old toPath:_new error:nil];
}
function cp(old, _new) {
[[NSFileManager defaultManager] copyItemAtPath:old toPath:_new error:nil];
}
function pwd() {
return [[NSFileManager defaultManager] currentDirectoryPath];
}
function mkdir(path) {
// This will act like mkdir -p, meaning intermediate dirs will be created
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment