replaced system() calls with FileUtils.* methods
Created by: koenpunt
This also makes that mv: cannot stat '/ho..
is not shown in the test :)
Merge request reports
Activity
Unable to load the diff Created by: dzaporozhets
@vsizov +1
By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)
By Administrator on 2013-01-03T14:37:36 (imported from GitLab)
Unable to load the diff Created by: koenpunt
I actually tested it although in IRB, and not in Gitlab environment. And I thought the tests would cover its functionality. But what you are saying is that supplying the mode to
FileUtils.mkdir
doesn't work?By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)
By Administrator on 2013-01-03T14:37:36 (imported from GitLab)
Unable to load the diff Created by: koenpunt
vagrant:/vagrant/gitlabhq system-to-fileutils → rails c Loading development environment (Rails 3.2.9) 1.9.3-p327 :001 > FileUtils.mkdir( '/tmp/mkdir_fileutils', :mode => 0770 ) => ["/tmp/mkdir_fileutils"] 1.9.3-p327 :002 > exit vagrant:/vagrant/gitlabhq system-to-fileutils → stat /tmp/mkdir_fileutils File: `/tmp/mkdir_fileutils' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: fc00h/64512d Inode: 1048616 Links: 2 Access: (0770/drwxrwx---) Uid: ( 1000/ vagrant) Gid: ( 1000/ vagrant) Access: 2012-12-07 10:37:06.269298460 +0000 Modify: 2012-12-07 10:37:06.269298460 +0000 Change: 2012-12-07 10:37:06.269298460 +0000 Birth: -
By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)
By Administrator on 2013-01-03T14:37:36 (imported from GitLab)
Unable to load the diff Created by: koenpunt
Ow and:
FileUtils.mkdir('/tmp/somedir', :mode => 0770, :verbose => true, :noop => true)
Logs:
mkdir -m 770 /tmp/somedir
And this is exactly how the code looks like in the
system
call, so if it's not working, please tell me why and not just 'this won't work', because that doesn't help anyone.By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)
By Administrator on 2013-01-03T14:37:36 (imported from GitLab)
Unable to load the diff Created by: vsizov
I don't know why. We had no time to find out why this happens. This one works in console but in live application not. I will be happy if you find the reason.
By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)
By Administrator on 2013-01-03T14:37:36 (imported from GitLab)
Unable to load the diff