{"action":"created","issue":{"url":"https://api.github.com/repos/dokan-dev/dokany/issues/406","repository_url":"https://api.github.com/repos/dokan-dev/dokany","labels_url":"https://api.github.com/repos/dokan-dev/dokany/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/dokan-dev/dokany/issues/406/comments","events_url":"https://api.github.com/repos/dokan-dev/dokany/issues/406/events","html_url":"https://github.com/dokan-dev/dokany/issues/406","id":192144250,"number":406,"title":"When using software written in the Go language, directories reportedly fail to open","user":{"login":"jetwhiz","id":533569,"avatar_url":"https://avatars.githubusercontent.com/u/533569?v=3","gravatar_id":"","url":"https://api.github.com/users/jetwhiz","html_url":"https://github.com/jetwhiz","followers_url":"https://api.github.com/users/jetwhiz/followers","following_url":"https://api.github.com/users/jetwhiz/following{/other_user}","gists_url":"https://api.github.com/users/jetwhiz/gists{/gist_id}","starred_url":"https://api.github.com/users/jetwhiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetwhiz/subscriptions","organizations_url":"https://api.github.com/users/jetwhiz/orgs","repos_url":"https://api.github.com/users/jetwhiz/repos","events_url":"https://api.github.com/users/jetwhiz/events{/privacy}","received_events_url":"https://api.github.com/users/jetwhiz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-28T23:16:50Z","updated_at":"2016-11-28T23:41:07Z","closed_at":null,"body":"# Environment\r\n * Windows version: Windows 7\r\n * Processor architecture: x86 and x64\r\n * Dokany version: 1.0.1.1000\r\n * Library type (Dokany/FUSE): FUSE\r\n \r\n# Check List\r\n  - [x] I checked my issue [doesn't exist yet](https://github.com/dokan-dev/dokany/issues?utf8=%E2%9C%93&q=is%3Aissue)\r\n  - [x] My issue is valid with mirror default sample and not specific to my user-mode driver implementation (fuse mirror)\r\n  - [x] I can always reproduce the issue with the provided description below.\r\n  - [x] I have updated Dokany to the [latest version](https://github.com/dokan-dev/dokany/releases) and have reboot my computer after.\r\n  - [?] I tested one of the last [snapshot](https://github.com/dokan-dev/dokany/wiki/Build#user-snapshot) from appveyor CI\r\n\r\n# Description\r\n\r\nThis is based on various bug reports that involve encfs4win: \r\n* https://github.com/ncw/rclone/issues/261\r\n* https://github.com/jetwhiz/encfs4win/issues/71\r\n\r\nFrom what I can tell, the Go programming language will attempt to open everything as a file first and then (only if that fails) does it try opening it as a directory (see https://github.com/golang/go/blob/master/src/os/file_windows.go#L150).  \r\n\r\nThis is apparently causing an issue with Dokany FUSE, since it looks like Dokany does not fail when attempting to open a directory as a file.  \r\n\r\nFor instance, the [rclone](https://github.com/ncw/rclone) program (written in Go), fails with the following error when trying to copy files out of the Dokany fuse mirror: \r\n\r\nWith UNC paths: \r\n> Local file system at \\\\\\\\?\\X:: Failed to open directory: \\\\\\\\?\\X:: Readdir \\\\\\\\?\\X:: The system cannot find the path specified.\r\n\r\nWithout UNC paths: \r\n> Local file system at X:: failed to read directory \"X:\\\\\": Readdir X:: The system cannot find the path specified.\r\n\r\n# Logs\r\n\r\n@qnorsten\r\n\r\nThis example was pulled off of my bug report: http://pastebin.com/QjeLcXY9\r\n"},"comment":{"url":"https://api.github.com/repos/dokan-dev/dokany/issues/comments/263430720","html_url":"https://github.com/dokan-dev/dokany/issues/406#issuecomment-263430720","issue_url":"https://api.github.com/repos/dokan-dev/dokany/issues/406","id":263430720,"user":{"login":"jetwhiz","id":533569,"avatar_url":"https://avatars.githubusercontent.com/u/533569?v=3","gravatar_id":"","url":"https://api.github.com/users/jetwhiz","html_url":"https://github.com/jetwhiz","followers_url":"https://api.github.com/users/jetwhiz/followers","following_url":"https://api.github.com/users/jetwhiz/following{/other_user}","gists_url":"https://api.github.com/users/jetwhiz/gists{/gist_id}","starred_url":"https://api.github.com/users/jetwhiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetwhiz/subscriptions","organizations_url":"https://api.github.com/users/jetwhiz/orgs","repos_url":"https://api.github.com/users/jetwhiz/repos","events_url":"https://api.github.com/users/jetwhiz/events{/privacy}","received_events_url":"https://api.github.com/users/jetwhiz/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T23:41:07Z","updated_at":"2016-11-28T23:41:07Z","body":"To fix the FUSE mirror, it might be enough to just do an lstat and S_ISDIR before calling open: \r\n\r\nhttps://github.com/dokan-dev/dokany/blob/master/samples/fuse_mirror/fusexmp.c#L246\r\n\r\nSince open() will not complain if a directory is passed in (unless write permissions are requested): \r\n\r\nhttps://linux.die.net/man/3/open\r\n\r\nBut I'm not sure if the problem goes deeper in Dokany or not. "}}
{"actor":{"display_login":"jetwhiz"}}