Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7123

How to delete a file that has a process running on it...

Newsgroups comp.lang.ruby
Date 2015-07-21 10:03 -0700
Message-ID <b45d3246-e870-4fc0-b510-90a335d729fe@googlegroups.com> (permalink)
Subject How to delete a file that has a process running on it...
From trekr5 <cebirim@gmail.com>

Show all headers | View raw


Hello,

I've got a situation where I want to delete a file, using Ruby, on a windows machine that is locked by another process.

I have tried a ruby block of opening and closing a file, unlocking the file using file.flock and then trying a FileUtils.rm(file).

However I've tried all of these methods and the file won't delete.

I've put exception handling around mo code and it returns a permission error when attempting to delete the file.

Does anyone know of a way to delete a file when it is locked by another process?

Thanks again.

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

How to delete a file that has a process running on it... trekr5 <cebirim@gmail.com> - 2015-07-21 10:03 -0700
  Re: How to delete a file that has a process running on it... Kaz Kylheku <kaz@kylheku.com> - 2015-07-21 20:53 +0000

csiph-web