{"action":"created","issue":{"url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/44","labels_url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/44/comments","events_url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/44/events","html_url":"https://github.com/alexcrichton/tar-rs/issues/44","id":123244521,"number":44,"title":"Long paths are truncated","user":{"login":"mbrt","id":405934,"avatar_url":"https://avatars.githubusercontent.com/u/405934?v=3","gravatar_id":"","url":"https://api.github.com/users/mbrt","html_url":"https://github.com/mbrt","followers_url":"https://api.github.com/users/mbrt/followers","following_url":"https://api.github.com/users/mbrt/following{/other_user}","gists_url":"https://api.github.com/users/mbrt/gists{/gist_id}","starred_url":"https://api.github.com/users/mbrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbrt/subscriptions","organizations_url":"https://api.github.com/users/mbrt/orgs","repos_url":"https://api.github.com/users/mbrt/repos","events_url":"https://api.github.com/users/mbrt/events{/privacy}","received_events_url":"https://api.github.com/users/mbrt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T09:54:43Z","updated_at":"2015-12-21T15:01:59Z","closed_at":null,"body":"Here is a tar file with a long path: [long_path.zip](https://github.com/alexcrichton/tar-rs/files/68313/long_path.zip) (zipped because github don't like tars).\r\n\r\nListing the content with `tar -tf long_path.tar` gives:\r\n```\r\nhome/\r\nhome/michele/\r\nhome/michele/Documenti/\r\nhome/michele/Documenti/Development/\r\nhome/michele/Documenti/Development/Progetti/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/WixIncludeMake/\r\nhome/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/WixIncludeMake/Program.cs\r\n```\r\n\r\nListing the contents with this snippet:\r\n```\r\nlet file = File::open(\"long_path.tar\").unwrap();\r\nlet mut tar = Archive::new(file);\r\nfor file in tar.files_mut().unwrap() {\r\n    if let Ok(f) = file {\r\n        println!(\"{:?}\", f.header().path().unwrap())\r\n    }\r\n}\r\n```\r\n\r\nGives the following result:\r\n```\r\n\"home/michele/\"\r\n\"home/michele/Documenti/\"\r\n\"home/michele/Documenti/Development/\"\r\n\"home/michele/Documenti/Development/Progetti/\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/\"\r\n\"././@LongLink\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/WixIn\"\r\n\"././@LongLink\"\r\n\"home/michele/Documenti/Development/Progetti/MetaCloudExperiment/Reference/duplicati/BuildTools/WixIn\"\r\n```\r\n\r\nTruncating paths and adding those `././@LongLink` entries."},"comment":{"url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/comments/166324584","html_url":"https://github.com/alexcrichton/tar-rs/issues/44#issuecomment-166324584","issue_url":"https://api.github.com/repos/alexcrichton/tar-rs/issues/44","id":166324584,"user":{"login":"aidanhs","id":1050652,"avatar_url":"https://avatars.githubusercontent.com/u/1050652?v=3","gravatar_id":"","url":"https://api.github.com/users/aidanhs","html_url":"https://github.com/aidanhs","followers_url":"https://api.github.com/users/aidanhs/followers","following_url":"https://api.github.com/users/aidanhs/following{/other_user}","gists_url":"https://api.github.com/users/aidanhs/gists{/gist_id}","starred_url":"https://api.github.com/users/aidanhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidanhs/subscriptions","organizations_url":"https://api.github.com/users/aidanhs/orgs","repos_url":"https://api.github.com/users/aidanhs/repos","events_url":"https://api.github.com/users/aidanhs/events{/privacy}","received_events_url":"https://api.github.com/users/aidanhs/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T15:01:59Z","updated_at":"2015-12-21T15:01:59Z","body":"This is the GNU extension to the tar format to support long (>255 chars) path names. See http://stackoverflow.com/questions/2078778/what-exactly-is-the-gnu-tar-longlink-trick\r\n\r\nI might be able to implement this in a couple of days if nobody else gets there first."}}