Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [nsfilemanager]

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

nsfilemanager
0 votes
0 answers
25 views

File size on iOS: does the usual technique `... .fileSize` give the bytes of the content, or, the "rounded" size in re drive formatting?

In iOS to grab the size of a file, file.resourceValues(forKeys: [.fileSizeKey]).fileSize (Example, size of a whole directory ) In short how does the chunk size of affect this result? Is the result ...
Fattie's user avatar
  • 13.9k
-4 votes
0 answers
29 views

How does one query for files and folders with FileManager, and then edit and sort them using SwiftUI? [closed]

I need to: Get an array of JSON files and store it in a variable Get an array of directories and store it in a variable For each of those folders, get their JSON files only Edit only the "text&...
Fedora Guy's user avatar
1 vote
1 answer
57 views

Swift FileManager.default.copyItem(at: URL, to: URL) folder permission error

I'm writing a small Mac OS X Desktop application that copies a random sampling of files from a source folder to a destination folder, see Select-Random-Files. The code that's giving me the most ...
belovachap's user avatar
-1 votes
0 answers
65 views

How to delete files thoroughly in iOS

I try to delete big file(1GB+) in the document directory of my developing App, the codes as below. When I deleted the file, but the space occupied by the app in iPhone storage has not changed. Does ...
zerxon's user avatar
  • 1
0 votes
0 answers
31 views

ContentsOfDirectory for FileProvider URLs

I'm developing an iOS app. Through a .fileImporter I get access to a directory URL which might be provided by an external service like Dropbox (using a FileProvider). As the user picked the URL I have ...
Dominik's user avatar
  • 756
0 votes
1 answer
118 views

swiftui photopicker video is not accessible after rerunning the application

I'm trying to pick a video with photo picker this way: @State var selectedItem: PhotosPickerItem? = nil @State var showPhotoPicker = false With those 2 states i'm showing the picker: ....
Udi Oshi's user avatar
  • 6,867
3 votes
0 answers
139 views

When .fileImporter is presented the Xcode console shows: "Unknown client: App Name"

I am writing my first SwiftUI app that uses the FileManager (via .fileImporter) to read data from a saved text (.csv) file. Although everything seems to be working OK, the Xcode console displays the ...
HirsuteJim's user avatar
2 votes
1 answer
166 views

Zip files of a Directory without any root folder

I want to zip files inside a folder in my iOS application written in the Swift language. I am using ZipFoundation CocoaPod of version 0.9.5. let fileManager = FileManager.default guard let sourceURL ...
Vivek's user avatar
  • 90
0 votes
0 answers
36 views

Downloading from iCloud, files truncated, fine from other sources

I'm using this code which is a mildly doctored version of an online tutorial. I understand the parts, but when I run it, the downloads happen, I get an error-free completion message. But the resulting ...
Dan Donaldson's user avatar
0 votes
1 answer
155 views

iOS: how to determine if a file is a bundle resource (included in IPA)

I'm building a framework, and need to differentiate between a file that is a bundle resource (included in the App Store IPA / static file defined at development time) and a file that the app creates (...
scosman's user avatar
  • 2,466
0 votes
3 answers
168 views

When we try to export CapturedRoom getting cannotCreateNode(path: "/9EE71ED0F8D6415496A7B9F0C3671DB0321") in

We are using the RoomPlan API to capture data, which is stored in the 'CapturedRoom' variable in our code (referred to as 'finalResult'). We then attempt to save a USDZ file in the file manager. ...
shiv's user avatar
  • 39
0 votes
2 answers
83 views

How to create model in Swift?

I am a beginner in the Swift language. I have multiple arrays in one view controller from which I am loading data in the tableview. My code is: let filemanager = FileManager.default var ...
Abhishek kumar's user avatar
0 votes
0 answers
57 views

What does SearchPathDomainMask mean in Swift?

In swift, we use Filemanager.default.url(for:in:) to get user directories or system directories. And we pass arguments typed SearchPathDirectory and SearchPathDomainMask to specify what urls we need. ...
ST K's user avatar
  • 109
1 vote
0 answers
46 views

How to create a temporary file container, file system, or custom file stream for intercepting clipboard access to temporary files on macOS?

I'm developing a cross-platform clipboard sharing software and currently working on implementing file copying functionality. On Windows, I can achieve file copy by creating an IDataObject and IStream, ...
gao.xiangyang's user avatar
0 votes
1 answer
188 views

I cannot access a file I have just saved to my documents directory

Here is my saving and retrieving code: func retrieveSong(songId: String) -> URL? { guard let pathComponent = cache[songId] else { return nil } if let ...
Halpo's user avatar
  • 3,074

15 30 50 per page
1
2 3 4 5
98