Issue 9013 in go: go.tools/refactor/rename: file permissions not preserved on rewrite

11 views
Skip to first unread message

g...@googlecode.com

unread,
Oct 28, 2014, 8:30:47 PM10/28/14
to golan...@googlegroups.com
Status: New
Owner: ----

New issue 9013 by niels.widger: go.tools/refactor/rename: file permissions
not preserved on rewrite
https://code.google.com/p/go/issues/detail?id=9013

The gorename command does not preserve existing file permissions when
rewriting a file back to disk.

$ umask
0022
$ chmod 755 file.go
$ ls -l file.go
# output shows file.go has permissions 755
$ gorename -from file.go::x -to y
$ ls -l file.go
# output shows file.go now has permissions 644

After looking briefly over the code, I think this may have to do with
os.Create using 0666 as the default permissions as detailed here:

http://golang.org/pkg/os/#Create

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

g...@googlecode.com

unread,
Oct 28, 2014, 11:07:04 PM10/28/14
to golan...@googlegroups.com
Updates:
Cc: adono...@google.com
Labels: Repo-Tools Release-None

Comment #1 on issue 9013 by i...@golang.org: go.tools/refactor/rename: file
permissions not preserved on rewrite
https://code.google.com/p/go/issues/detail?id=9013

(No comment was entered for this change.)

g...@googlecode.com

unread,
Dec 4, 2014, 5:30:44 PM12/4/14
to golan...@googlegroups.com
Updates:
Owner: adono...@google.com

Comment #2 on issue 9013 by adono...@google.com: go.tools/refactor/rename:

g...@googlecode.com

unread,
Dec 4, 2014, 6:10:10 PM12/4/14
to golan...@googlegroups.com

Comment #3 on issue 9013 by go...@golang.org: go.tools/refactor/rename:
file permissions not preserved on rewrite
https://code.google.com/p/go/issues/detail?id=9013#c3

CL https://codereview.appspot.com/185000043 mentions this issue.

g...@googlecode.com

unread,
Dec 5, 2014, 2:07:18 PM12/5/14
to golan...@googlegroups.com
Updates:
Status: Fixed

Comment #5 on issue 9013 by adono...@google.com: go.tools/refactor/rename:
file permissions not preserved on rewrite
https://code.google.com/p/go/issues/detail?id=9013

This issue was closed by revision 8865ff253ddb.
Reply all
Reply to author
Forward
0 new messages