The NSFileManager class enables you to perform various generic file-system operations and insulates an application from the underlying file system.
I would like to open a .txt file and save the content as a String. I tried this: let path = …
swift macos cocoa nsfilemanagerIn my code, which works, I am returning a [String]? containing the names of the files (lastPathComponent) stored in /Documents/ …
ios swift nsfilemanagerRight now I'm using this code to get the size of a folder: NSArray *contents; NSEnumerator *enumerator; NSString *path; contents = [[…
objective-c cocoa size directory nsfilemanagerI want to use the octal permissions (used for chmod) for NSFilePosixPermissions. Here is what I did now: NSFileManager *manager = […
xcode permissions nsdictionary nsfilemanager chmodI am trying to return the list of directories present in an app's Documents directory. I am able to get …
iphone nsfilemanagerI need to copy a few sample files from my app's resource folder and place them in my app's document …
iphone cocoa document nsfilemanager copyingTrying to get content of Caches directory: NSError *error; NSString *path = [[self.class cachesDirectoryURL] absoluteString]; NSArray *directoryItems = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:…
ios objective-c nsfilemanagerWhat I want to do seems simple enough: Get an array of filenames in a given "directory" on my app. …
iphone xcode filesystems nsfilemanager nsbundleI'm trying to remove a file from the documents directory using FileManager.default.removeItem but is not deleting the file …
ios swift swift3 nsfilemanagerIf like to attain functionality similar to that of Bash's -d if condition. I am aware of how to test …
swift directory swift2 nsfilemanager