Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rye::Cmd.rm sometimes fails to remove recursive directories #29

Open
rajsahae opened this issue Feb 26, 2013 · 1 comment
Open

Rye::Cmd.rm sometimes fails to remove recursive directories #29

rajsahae opened this issue Feb 26, 2013 · 1 comment

Comments

@rajsahae
Copy link

I have a method which simply removes an entire directory.

def remove_cache
  # Remove the cache
  begin
    @system_rye.disable_safe_mode
    @system_rye.rm(:r, :f, @@cache_path)
  ensure
    @system_rye.enable_safe_mode
  end
end

Sometimes, seemingly random, the remove method will raise an errer and claim to be unable to remove the directory.

rm: cannot remove `/home/some_application/cache/map/http': Directory not empty
/home/rsahae/.rvm/gems/ruby-1.9.3-p327/gems/rye-0.9.8/lib/rye/box.rb:858:in `rescue in run_command': rm: cannot remove `/home/some_application/cache/map/http': Directory not empty (cmd: rm -r -f /home/some_application/cache/map; status: 1) (Rye::Err)
        from /home/rsahae/.rvm/gems/ruby-1.9.3-p327/gems/rye-0.9.8/lib/rye/box.rb:809:in `run_command'
        from /home/rsahae/.rvm/gems/ruby-1.9.3-p327/gems/rye-0.9.8/lib/rye/box.rb:473:in `method_missing'
        from /home/rsahae/dev/maps_performance/lib/maps_performance/maps_performance_tester.rb:276:in `rescue in remove_cache'
        from /home/rsahae/dev/maps_performance/lib/maps_performance/maps_performance_tester.rb:279:in `remove_cache'
        from /home/rsahae/dev/maps_performance/lib/maps_performance/maps_performance_tester.rb:81:in `block in run_tests'
        from /home/rsahae/dev/maps_performance/lib/maps_performance/maps_performance_tester.rb:69:in `each'
        from /home/rsahae/dev/maps_performance/lib/maps_performance/maps_performance_tester.rb:69:in `run_tests'
        from bin/maps_perf_test.rb:24:in `<main>'
@delano
Copy link
Owner

delano commented Mar 3, 2013

Hmm, the error message is coming from the rm command and not rye itself. The only thing I can think of is that somehow the -r -f flags aren't being passed along. If it happens again, run rye with debugging enabled and send that output (Rye::DEBUG=true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants