You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the `FileManager.default.attributesOfItem` function takes upwards of 10 seconds to run at times.
Example
NSLog("checking if it exists")
if FileManager.default.fileExists(atPath:ServerCache.path){letnow=Date()NSLog("reading the modification date")letmodDate=try!FileManager.default.attributesOfItem(atPath:ServerCache.path)[.modificationDate]as!Date
if modDate.distance(to: now)<ServerCache.expiry {NSLog("reading from the file")letcacheData=try!String.init(contentsOfFile:ServerCache.path, encoding:.utf8)NSLog("finished reading from file")}}
The above code results in the following log messages (note the timestamps)
I'm seeing this problem also in my unit tests. It's only happening on macOS on my local machine. Runs nice and quick on the iOS simulator and on my CI machine.
Also, its only happening for the first file that I read attributes from. If I read attributes of a second file, it is fast again.
Environment
macOS 11.0.1
Additional Detail from JIRA
md5: b51fca1a0395e45f27d98eafdf1508b4
Issue Description:
It seems that the `FileManager.default.attributesOfItem` function takes upwards of 10 seconds to run at times.
Example
The above code results in the following log messages (note the timestamps)
The text was updated successfully, but these errors were encountered: