I am moving files from folder to folder. I would think there is a convince method in NSFileManager that returns the full string or URL path to a file. I can easily get the contents of a directory like this
As I NSLog the array it contains the file names. I would like to get the full paths to the files. Is there a simple method to return the full path? I looked through the docs for NSFileManager and the moveItemsAtPath: method expects the full path to the item.
Is there no method like this sudo code -(NSArray*)contentPathsAtDirectory:?
BTW, I am able to get the path of the files in question and move them just fine. I was just wondering if there was a method that I am missing that simplifies this process?
Code:
NSFileManager *fm = [NSFileManager defaultManager];
NSString *filepath = @"~/SomeDirectory";
filepath = [filepath stringByExpandingTildeInPath];
NSArray *fileNamesArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:filepath error:NULL];
As I NSLog the array it contains the file names. I would like to get the full paths to the files. Is there a simple method to return the full path? I looked through the docs for NSFileManager and the moveItemsAtPath: method expects the full path to the item.
Is there no method like this sudo code -(NSArray*)contentPathsAtDirectory:?
BTW, I am able to get the path of the files in question and move them just fine. I was just wondering if there was a method that I am missing that simplifies this process?