{"action":"created","comment":{"url":"https://api.github.com/repos/suffuse/idfs/pulls/comments/55944620","id":55944620,"diff_hunk":"@@ -50,7 +51,11 @@ package object jio extends JioFiles {\n       Files.setLastModifiedTime(path, jnfa.FileTime.from(nanoSeconds, TimeUnit.NANOSECONDS))\n \n     def tryLock():jnc.FileLock     = withWriteChannel(_.tryLock)\n-    def truncate(size: Long): Unit = withWriteChannel(_ truncate size )\n+    def truncate(size: Long): Unit = withWriteChannel {\n+      case c if c.size > size => c truncate size\n+      case c if c.size < size => c write (ByteBuffer wrap Array.fill((size - c.size).toInt)(0.toByte), c.size)\n+      case _                  => // sizes are equal","path":"src/main/scala/jio/package.scala","position":16,"original_position":16,"commit_id":"e9805fd81448e8754a7d7f20456bc0af177a7d27","original_commit_id":"e9805fd81448e8754a7d7f20456bc0af177a7d27","user":{"login":"paulp","id":9135,"avatar_url":"https://avatars.githubusercontent.com/u/9135?v=3","gravatar_id":"","url":"https://api.github.com/users/paulp","html_url":"https://github.com/paulp","followers_url":"https://api.github.com/users/paulp/followers","following_url":"https://api.github.com/users/paulp/following{/other_user}","gists_url":"https://api.github.com/users/paulp/gists{/gist_id}","starred_url":"https://api.github.com/users/paulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulp/subscriptions","organizations_url":"https://api.github.com/users/paulp/orgs","repos_url":"https://api.github.com/users/paulp/repos","events_url":"https://api.github.com/users/paulp/events{/privacy}","received_events_url":"https://api.github.com/users/paulp/received_events","type":"User","site_admin":false},"body":"And having a method called \"truncate\" which expands the file arbitrarily large... but I guess if we're really going for the identity filesystem those are the required semantics.","created_at":"2016-03-13T22:06:59Z","updated_at":"2016-03-13T22:06:59Z","html_url":"https://github.com/suffuse/idfs/pull/7#discussion_r55944620","pull_request_url":"https://api.github.com/repos/suffuse/idfs/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/comments/55944620"},"html":{"href":"https://github.com/suffuse/idfs/pull/7#discussion_r55944620"},"pull_request":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/suffuse/idfs/pulls/7","id":62683241,"html_url":"https://github.com/suffuse/idfs/pull/7","diff_url":"https://github.com/suffuse/idfs/pull/7.diff","patch_url":"https://github.com/suffuse/idfs/pull/7.patch","issue_url":"https://api.github.com/repos/suffuse/idfs/issues/7","number":7,"state":"open","locked":false,"title":"Correctness","user":{"login":"EECOLOR","id":1486362,"avatar_url":"https://avatars.githubusercontent.com/u/1486362?v=3","gravatar_id":"","url":"https://api.github.com/users/EECOLOR","html_url":"https://github.com/EECOLOR","followers_url":"https://api.github.com/users/EECOLOR/followers","following_url":"https://api.github.com/users/EECOLOR/following{/other_user}","gists_url":"https://api.github.com/users/EECOLOR/gists{/gist_id}","starred_url":"https://api.github.com/users/EECOLOR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EECOLOR/subscriptions","organizations_url":"https://api.github.com/users/EECOLOR/orgs","repos_url":"https://api.github.com/users/EECOLOR/repos","events_url":"https://api.github.com/users/EECOLOR/events{/privacy}","received_events_url":"https://api.github.com/users/EECOLOR/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-13T21:02:42Z","updated_at":"2016-03-13T22:06:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e59f945070213468c25c7016d63acd223152cfd2","assignee":{"login":"paulp","id":9135,"avatar_url":"https://avatars.githubusercontent.com/u/9135?v=3","gravatar_id":"","url":"https://api.github.com/users/paulp","html_url":"https://github.com/paulp","followers_url":"https://api.github.com/users/paulp/followers","following_url":"https://api.github.com/users/paulp/following{/other_user}","gists_url":"https://api.github.com/users/paulp/gists{/gist_id}","starred_url":"https://api.github.com/users/paulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulp/subscriptions","organizations_url":"https://api.github.com/users/paulp/orgs","repos_url":"https://api.github.com/users/paulp/repos","events_url":"https://api.github.com/users/paulp/events{/privacy}","received_events_url":"https://api.github.com/users/paulp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/suffuse/idfs/pulls/7/commits","review_comments_url":"https://api.github.com/repos/suffuse/idfs/pulls/7/comments","review_comment_url":"https://api.github.com/repos/suffuse/idfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/suffuse/idfs/issues/7/comments","statuses_url":"https://api.github.com/repos/suffuse/idfs/statuses/e9805fd81448e8754a7d7f20456bc0af177a7d27","head":{"label":"suffuse:correctness","ref":"correctness","sha":"e9805fd81448e8754a7d7f20456bc0af177a7d27","user":{"login":"suffuse","id":10980633,"avatar_url":"https://avatars.githubusercontent.com/u/10980633?v=3","gravatar_id":"","url":"https://api.github.com/users/suffuse","html_url":"https://github.com/suffuse","followers_url":"https://api.github.com/users/suffuse/followers","following_url":"https://api.github.com/users/suffuse/following{/other_user}","gists_url":"https://api.github.com/users/suffuse/gists{/gist_id}","starred_url":"https://api.github.com/users/suffuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suffuse/subscriptions","organizations_url":"https://api.github.com/users/suffuse/orgs","repos_url":"https://api.github.com/users/suffuse/repos","events_url":"https://api.github.com/users/suffuse/events{/privacy}","received_events_url":"https://api.github.com/users/suffuse/received_events","type":"Organization","site_admin":false},"repo":{"id":53703735,"name":"idfs","full_name":"suffuse/idfs","owner":{"login":"suffuse","id":10980633,"avatar_url":"https://avatars.githubusercontent.com/u/10980633?v=3","gravatar_id":"","url":"https://api.github.com/users/suffuse","html_url":"https://github.com/suffuse","followers_url":"https://api.github.com/users/suffuse/followers","following_url":"https://api.github.com/users/suffuse/following{/other_user}","gists_url":"https://api.github.com/users/suffuse/gists{/gist_id}","starred_url":"https://api.github.com/users/suffuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suffuse/subscriptions","organizations_url":"https://api.github.com/users/suffuse/orgs","repos_url":"https://api.github.com/users/suffuse/repos","events_url":"https://api.github.com/users/suffuse/events{/privacy}","received_events_url":"https://api.github.com/users/suffuse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/suffuse/idfs","description":"identity fuse filesystem, toward lowering the fuse/unix/java impedance mismatches","fork":false,"url":"https://api.github.com/repos/suffuse/idfs","forks_url":"https://api.github.com/repos/suffuse/idfs/forks","keys_url":"https://api.github.com/repos/suffuse/idfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suffuse/idfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suffuse/idfs/teams","hooks_url":"https://api.github.com/repos/suffuse/idfs/hooks","issue_events_url":"https://api.github.com/repos/suffuse/idfs/issues/events{/number}","events_url":"https://api.github.com/repos/suffuse/idfs/events","assignees_url":"https://api.github.com/repos/suffuse/idfs/assignees{/user}","branches_url":"https://api.github.com/repos/suffuse/idfs/branches{/branch}","tags_url":"https://api.github.com/repos/suffuse/idfs/tags","blobs_url":"https://api.github.com/repos/suffuse/idfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suffuse/idfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suffuse/idfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/suffuse/idfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suffuse/idfs/statuses/{sha}","languages_url":"https://api.github.com/repos/suffuse/idfs/languages","stargazers_url":"https://api.github.com/repos/suffuse/idfs/stargazers","contributors_url":"https://api.github.com/repos/suffuse/idfs/contributors","subscribers_url":"https://api.github.com/repos/suffuse/idfs/subscribers","subscription_url":"https://api.github.com/repos/suffuse/idfs/subscription","commits_url":"https://api.github.com/repos/suffuse/idfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/suffuse/idfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/suffuse/idfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/suffuse/idfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/suffuse/idfs/contents/{+path}","compare_url":"https://api.github.com/repos/suffuse/idfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suffuse/idfs/merges","archive_url":"https://api.github.com/repos/suffuse/idfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suffuse/idfs/downloads","issues_url":"https://api.github.com/repos/suffuse/idfs/issues{/number}","pulls_url":"https://api.github.com/repos/suffuse/idfs/pulls{/number}","milestones_url":"https://api.github.com/repos/suffuse/idfs/milestones{/number}","notifications_url":"https://api.github.com/repos/suffuse/idfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suffuse/idfs/labels{/name}","releases_url":"https://api.github.com/repos/suffuse/idfs/releases{/id}","deployments_url":"https://api.github.com/repos/suffuse/idfs/deployments","created_at":"2016-03-11T23:49:27Z","updated_at":"2016-03-11T23:49:47Z","pushed_at":"2016-03-13T22:04:00Z","git_url":"git://github.com/suffuse/idfs.git","ssh_url":"git@github.com:suffuse/idfs.git","clone_url":"https://github.com/suffuse/idfs.git","svn_url":"https://github.com/suffuse/idfs","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"suffuse:master","ref":"master","sha":"e3d436fedc5892dfcfc4c7c37df8becb0e60a3bd","user":{"login":"suffuse","id":10980633,"avatar_url":"https://avatars.githubusercontent.com/u/10980633?v=3","gravatar_id":"","url":"https://api.github.com/users/suffuse","html_url":"https://github.com/suffuse","followers_url":"https://api.github.com/users/suffuse/followers","following_url":"https://api.github.com/users/suffuse/following{/other_user}","gists_url":"https://api.github.com/users/suffuse/gists{/gist_id}","starred_url":"https://api.github.com/users/suffuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suffuse/subscriptions","organizations_url":"https://api.github.com/users/suffuse/orgs","repos_url":"https://api.github.com/users/suffuse/repos","events_url":"https://api.github.com/users/suffuse/events{/privacy}","received_events_url":"https://api.github.com/users/suffuse/received_events","type":"Organization","site_admin":false},"repo":{"id":53703735,"name":"idfs","full_name":"suffuse/idfs","owner":{"login":"suffuse","id":10980633,"avatar_url":"https://avatars.githubusercontent.com/u/10980633?v=3","gravatar_id":"","url":"https://api.github.com/users/suffuse","html_url":"https://github.com/suffuse","followers_url":"https://api.github.com/users/suffuse/followers","following_url":"https://api.github.com/users/suffuse/following{/other_user}","gists_url":"https://api.github.com/users/suffuse/gists{/gist_id}","starred_url":"https://api.github.com/users/suffuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suffuse/subscriptions","organizations_url":"https://api.github.com/users/suffuse/orgs","repos_url":"https://api.github.com/users/suffuse/repos","events_url":"https://api.github.com/users/suffuse/events{/privacy}","received_events_url":"https://api.github.com/users/suffuse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/suffuse/idfs","description":"identity fuse filesystem, toward lowering the fuse/unix/java impedance mismatches","fork":false,"url":"https://api.github.com/repos/suffuse/idfs","forks_url":"https://api.github.com/repos/suffuse/idfs/forks","keys_url":"https://api.github.com/repos/suffuse/idfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suffuse/idfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suffuse/idfs/teams","hooks_url":"https://api.github.com/repos/suffuse/idfs/hooks","issue_events_url":"https://api.github.com/repos/suffuse/idfs/issues/events{/number}","events_url":"https://api.github.com/repos/suffuse/idfs/events","assignees_url":"https://api.github.com/repos/suffuse/idfs/assignees{/user}","branches_url":"https://api.github.com/repos/suffuse/idfs/branches{/branch}","tags_url":"https://api.github.com/repos/suffuse/idfs/tags","blobs_url":"https://api.github.com/repos/suffuse/idfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suffuse/idfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suffuse/idfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/suffuse/idfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suffuse/idfs/statuses/{sha}","languages_url":"https://api.github.com/repos/suffuse/idfs/languages","stargazers_url":"https://api.github.com/repos/suffuse/idfs/stargazers","contributors_url":"https://api.github.com/repos/suffuse/idfs/contributors","subscribers_url":"https://api.github.com/repos/suffuse/idfs/subscribers","subscription_url":"https://api.github.com/repos/suffuse/idfs/subscription","commits_url":"https://api.github.com/repos/suffuse/idfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/suffuse/idfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/suffuse/idfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/suffuse/idfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/suffuse/idfs/contents/{+path}","compare_url":"https://api.github.com/repos/suffuse/idfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suffuse/idfs/merges","archive_url":"https://api.github.com/repos/suffuse/idfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suffuse/idfs/downloads","issues_url":"https://api.github.com/repos/suffuse/idfs/issues{/number}","pulls_url":"https://api.github.com/repos/suffuse/idfs/pulls{/number}","milestones_url":"https://api.github.com/repos/suffuse/idfs/milestones{/number}","notifications_url":"https://api.github.com/repos/suffuse/idfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suffuse/idfs/labels{/name}","releases_url":"https://api.github.com/repos/suffuse/idfs/releases{/id}","deployments_url":"https://api.github.com/repos/suffuse/idfs/deployments","created_at":"2016-03-11T23:49:27Z","updated_at":"2016-03-11T23:49:47Z","pushed_at":"2016-03-13T22:04:00Z","git_url":"git://github.com/suffuse/idfs.git","ssh_url":"git@github.com:suffuse/idfs.git","clone_url":"https://github.com/suffuse/idfs.git","svn_url":"https://github.com/suffuse/idfs","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/7"},"html":{"href":"https://github.com/suffuse/idfs/pull/7"},"issue":{"href":"https://api.github.com/repos/suffuse/idfs/issues/7"},"comments":{"href":"https://api.github.com/repos/suffuse/idfs/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/suffuse/idfs/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/suffuse/idfs/statuses/e9805fd81448e8754a7d7f20456bc0af177a7d27"}}}}