Post

Replies

Boosts

Views

Activity

Reply to FileManager Appends Additional / in file path
Thank you! That is very interesting, I didn't know about the 'safe save' operation! As far as the title of my post goes, I accidentally published before I had a chance to update the title of the post. While debugging this issue with my team, we found that my file manager adds an additional / in the path name - it was the only difference between my experience on my machine and my teammates' experiences on their respective machines, so it was the only lead I had for a while. I'm working on the iOS platform on a framework. This scenario arose while running tests that touch the FileManager - without revealing too much sensitive information, the test in question grabs a file in the project and uses the file manager to convert the file into data so that we can create an object from that data. Every time we try and call the 'fileManager.contents(atPath:)' method, it crashes because it is nil despite being able to see the file in its expected location in Finder. When we first discovered that the only difference between my scenario and my co-workers scenario was an additional errant / in the path name, we tried just removing the additional slash but it still returned nil for the file.
Oct ’24