# Yet another linux \<-\> win32 question

**URL:** <https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387>\
**Category:** Ruby\
**Created:** [February 3, 2007, 10:00pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387 "2007-02-03T22:00:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:00pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/1 "2007-02-03T22:00:15Z")

</div>

Hi,

Sorry for these dumb questions but I am really off when it comes to  
doing anything with win32.

So, the thing is that I have a function that creates a temp file, then  
does something with it and deletes it. I am doing this with

File.delete(temp\_filename)

On linux this script runs without any problems, however under windows I  
am getting 'Permission denied (Errno::EACCESS).

Since the file is unquestionably deletable, I think maybe windows locks  
it for whatever reason (or maybe not) - am I doing something wrong, or  
if not, is there a workaround for this?

Thanks,  
Peter

\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com)

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:13pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/2 "2007-02-03T22:13:16Z")

</div>

On Sun, 4 Feb 2007, Peter S. wrote:

> On linux this script runs without any problems, however under windows I am  
> getting 'Permission denied (Errno::EACCESS).
> 
> Since the file is unquestionably deletable, I think maybe windows locks it  
> for whatever reason (or maybe not) - am I doing something wrong, or if not,  
> is there a workaround for this?
> 
> Thanks,  
> Peter

gem install linux ??

-a

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:19pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/3 "2007-02-03T22:19:16Z")

</div>

On Sun, Feb 04, 2007 at 05:59:48AM +0900, Peter S. wrote:

> On linux this script runs without any problems, however under windows I  
> am getting 'Permission denied (Errno::EACCESS).
> 
> Since the file is unquestionably deletable, I think maybe windows locks  
> it for whatever reason (or maybe not) - am I doing something wrong, or  
> if not, is there a workaround for this?

Did you #close the file before you tried to delete it?

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/4 "2007-02-03T22:27:17Z")

</div>

> gem install linux ??

peter@brain:~$ sudo gem install linux  
Password:  
ERROR: While executing gem … (Gem::GemNotFoundException)  
Could not find linux (\> 0) in the repository

Ok, now seriously: I am doing this just to make sure that the gem I am  
going to release runs on win32, too. I have a heap of blackbox tests  
which I am using besides unit tests to make sure things are working  
properly. All I want is to run these tests on win, then go back to my  
ubuntu box.

Peter

\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com)

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/5 "2007-02-03T22:31:17Z")

</div>

> Did you #close the file before you tried to delete it?

Yep. This does not help…  
Here is a similar (or maybe) identical question (I did not find the  
answer to it):

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/123985](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/123985)

Peter

\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com)

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/6 "2007-02-03T22:50:19Z")

</div>

> Have you tried using Tempfile instead? Or would Tempfile not fit your  
> needs? Or is Tempfile doing the same thing?

Thanks for the tip! I will try it with a Temofile now and let’s see.

Cheers,  
Peter

\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com)

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [February 3, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/yet-another-linux-win32-question/84387/7 "2007-02-03T22:45:19Z")

</div>

On Feb 3, 2:30 pm, Peter S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \_\_[http://www.rubyrailways.com](http://www.rubyrailways.com)  
> Have you tried using Tempfile instead? Or would Tempfile not fit your  
> needs? Or is Tempfile doing the same thing?
