[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

yet another linux <-> win32 question

Peter Szinek

2/3/2007 9:00:00 PM

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.rubyra...

6 Answers

Ara.T.Howard

2/3/2007 9:13:00 PM

0

Logan Capaldo

2/3/2007 9:19:00 PM

0

On Sun, Feb 04, 2007 at 05:59:48AM +0900, Peter Szinek wrote:
> 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?
>
Did you #close the file before you tried to delete it?
> Thanks,
> Peter
>
> __
> http://www.rubyra...

Peter Szinek

2/3/2007 9:26:00 PM

0

> 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.rubyra...



Peter Szinek

2/3/2007 9:30:00 PM

0

> 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-t...

Peter

__
http://www.rubyra...


Chris Shea

2/3/2007 9:43:00 PM

0

On Feb 3, 2:30 pm, Peter Szinek <p...@rubyrailways.com> wrote:
> > 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-t...
>
> Peter
>
> __http://www.rubyra...

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

Peter Szinek

2/3/2007 9:49:00 PM

0

> 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.rubyra...