{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/1295","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/1295/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/1295/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/1295/events","html_url":"https://github.com/syncthing/syncthing/issues/1295","id":55391650,"number":1295,"title":"File / Dir name length and Windows","user":{"login":"RafiKueng","id":937466,"avatar_url":"https://avatars.githubusercontent.com/u/937466?v=3","gravatar_id":"","url":"https://api.github.com/users/RafiKueng","html_url":"https://github.com/RafiKueng","followers_url":"https://api.github.com/users/RafiKueng/followers","following_url":"https://api.github.com/users/RafiKueng/following{/other_user}","gists_url":"https://api.github.com/users/RafiKueng/gists{/gist_id}","starred_url":"https://api.github.com/users/RafiKueng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RafiKueng/subscriptions","organizations_url":"https://api.github.com/users/RafiKueng/orgs","repos_url":"https://api.github.com/users/RafiKueng/repos","events_url":"https://api.github.com/users/RafiKueng/events{/privacy}","received_events_url":"https://api.github.com/users/RafiKueng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/syncthing/syncthing/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-01-25T01:29:48Z","updated_at":"2015-01-26T17:52:14Z","closed_at":null,"body":"This is not really a bug in syncthing, but one in windows / ntfs to be aware of and (maybe) to work around:\r\n\r\nPathnames in NTFS are usually restricted to 256 chars (260-4: 'C:\\' in the beginning and \\NULL at the end; it's complicated, see [1] and [2]):\r\n> \"In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.\" [2]\r\n\r\nSo a perfect valid `long255charfilename.ext` with 255 chars won't be synced, because the creation of the temp file `~syncthing~.long255charfilename.ext.tmp` fails in the sync target (the one receiving the file) [3]\r\n\r\nIf I read the docs [2] correctly, there are \"extended-length path for a maximum total path length of 32,767 characters\". So all you should have to do is to prefix your paths with \"\\\\\\\\?\\\" if using the proper api calls. But be aware that the conversion of '/' to '\\' wont work anymore and relative path using dots neither  (Again, all according to the docs, I did not test this, since I don't have a win machine set up for dev at the moment)\r\n\r\n\r\nA side effect would then probably be, that those files won't be accessible in windows explorer and certain applications.. But the files are there and applications with proper long file name support should be able to read them. Thats what I would propose as the best way to handle it.\r\n\r\n\r\n[1] http://stackoverflow.com/questions/265769/maximum-filename-length-in-ntfs-windows-xp-and-windows-vista\r\n[2] https://msdn.microsoft.com/en-us/library/aa365247.aspx\r\n[3] The error message: (running on win8.1 x64)\r\n```\r\n[NLXEG] 23:43:22 INFO: Puller (folder \"documents\", file \"Uni\\\\Lectures\\\\INI410 - The Neurobiology of Consciousness - Daniel Kiper, Alex Gamma (Daniel Koch, Heather Berlin) - HS2008\\\\Lecture Sildes\\\\Lect 10 - Conclusions to Consciousness from Split-Brain Patients and Agnosias [Dr. H. Berlin].pdf\"):\r\ndst create: open s='D:\\data\\Documents\\Uni\\Lectures\\INI410 - The Neurobiology of Consciousness - Daniel Kiper, Alex Gamma (Daniel Koch, Heather Berlin) - HS2008\\Lecture Sildes\\~syncthing~.Lect 10 - Conclusions to Consciousness from Split-Brain Patients and Agnosias [Dr. H. Berlin].pdf.tmp': Das System kann den angegebenen Pfad nicht finden.\r\n```"},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/71504430","html_url":"https://github.com/syncthing/syncthing/issues/1295#issuecomment-71504430","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/1295","id":71504430,"user":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T17:52:14Z","updated_at":"2015-01-26T17:52:14Z","body":"I guess @calmh should make a decision about this and close it.\r\nI feel it wouldn't make it any worse, but it does involve writing a bit of code to make this happen."}}