Cannot open ".icloud" file with NSOpenPanel

Originator:krivoblotsky
Number:rdar://27966701 Date Originated:23-Aug-2016 04:24 PM
Status:Open Resolved:
Product:OSX SDK Product Version:
Classification: Reproducible:Always
 
Summary:
There is no ability to select the file that has been synced to iCloud and replaced with ".cloud" alias with NSOpenPanel. OpenPanel.URLs contain parent folder path instead of correct file path. For example, while trying to select a file from "~/Desktop/.filename.icloud", urls will contain "~/Desktop/".

Steps to Reproduce:
1. Enable iCloud Drive sync in Preferences->iCloud Drive->Options->Check "Desktop and Document Folders"
2. Extract example project from attached OpenPanelBug.zip
3. Build and run the application.
4. Press "Add Files" button, select a file that has been synced to iCloud, but replaced with alias. (".icloud" extension on disk, but looks like regular file with "not dowloaded" cloud icon)
5. Observe the log in Xcode.

Expected Results:
NSOpenPanel's "urls" contain correct file path, fox example:
Result urls - (
    "file:///path_to_file/folder/.filename.icloud"
)

Actual Results:
NSOpenPanel's "urls" contain parent folder of the file, for example:
Result urls - (
    "file:///path_to_file/folder/"
)

Version:
macOS Sierra 10.12 Beta (16A304a)
Xcode Version 8.0 beta 6 (8S201h)

Notes:
Reproducible with Apple software as well. Please find STR with Mail.app below.
1. Open Mail.app
2. Create new mail.
3. Click "Attach a document to this message" in the top right corner.
4. Select a file that has been synced to iCloud, but replaced with alias. (".icloud" extension on disk, but looks like regular file with "not dowloaded" cloud icon)
5. Observe an attachment.

Configuration:
iCloud Drive "Desktop and Documents Folders" sync feature should be enabled. 

Attachments:
'OpenPanelBug.zip' and 'Screen Shot 2016-08-23 at 3.53.26 PM.png' were successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!