Top "Nsfilemanager" questions

The NSFileManager class enables you to perform various generic file-system operations and insulates an application from the underlying file system.

The file “xxx” couldn’t be opened because there is no such file

I would like to open a .txt file and save the content as a String. I tried this: let path = …

swift macos cocoa nsfilemanager
Swift 2 iOS - get file list sorted by creation date - more concise solution?

In my code, which works, I am returning a [String]? containing the names of the files (lastPathComponent) stored in /Documents/ …

ios swift nsfilemanager
Easy way to get size of folder (ObjC/Cocoa)?

Right 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 nsfilemanager
NSFileManager & NSFilePosixPermissions

I want to use the octal permissions (used for chmod) for NSFilePosixPermissions. Here is what I did now: NSFileManager *manager = […

xcode permissions nsdictionary nsfilemanager chmod
Get array of directories in documents directory

I am trying to return the list of directories present in an app's Documents directory. I am able to get …

iphone nsfilemanager
NSFileManager - Copying Files at Startup

I 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 copying
iOS: Can't get content of Caches directory

Trying to get content of Caches directory: NSError *error; NSString *path = [[self.class cachesDirectoryURL] absoluteString]; NSArray *directoryItems = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:…

ios objective-c nsfilemanager
How do I get an NSArray of filenames of all files in a given directory in my app?

What I want to do seems simple enough: Get an array of filenames in a given "directory" on my app. …

iphone xcode filesystems nsfilemanager nsbundle
FileManager.default.removeItem not removing file

I'm trying to remove a file from the documents directory using FileManager.default.removeItem but is not deleting the file …

ios swift swift3 nsfilemanager
Check if path is a directory in Swift2?

If like to attain functionality similar to that of Bash's -d if condition. I am aware of how to test …

swift directory swift2 nsfilemanager