delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/13/12:27:06

Message-Id: <200109131627.MAA21700@delorie.com>
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Mark Paulus" <commpg AT yahoo DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Date: Thu, 13 Sep 2001 10:26:46 -0600
Reply-To: "Mark Paulus" <commpg AT yahoo DOT com>
X-Mailer: PMMail 2000 Professional (2.20.2350) For Windows 2000 (5.0.2195;2)
In-Reply-To: <3BA00AD7.D06F7377@acedsl.com>
MIME-Version: 1.0
Subject: Re: mv implemented as cp?!?!?!!? - problem!!

This brings up an interesting issue.  I'm not sure where the problem
lies, or who is responsible for which piece but I will try to describe this
as cohesively and clearly as I can.  

On my win2K box using FAT32, I have a perl script that does the following:
create a temp directory - foo
does a tar extract of  tarballname into foo/tarballname
rename foo/tarballname tarballname    
rmdir foo

Now, it appears that if the directory structure under tarballname is
sufficiently large, the rename command is not actually completed 
before control is returned to the perl script, and rmdir foo is invoked.
This causes rmdir foo to fail with a Permission Denied error.  However,
after the script runs, foo is empty.  And if I place a sleep(1) between
the rename foo... and rmdir foo, the script completes successfully.

Thinking about this as I write it, it seems to me that whatever is happening
in the rename() perl command, it is not being handled as an atomic unit,
and control is returning to the perl script before the system has actually
completed the rename operation.

Is there some system switch that controls when/how control is returned
in these types of scenarios, as adding random sleeps is neither precise
enough, nor is it even preferred?



On Wed, 12 Sep 2001 21:24:39 -0400, Matthew O. Persico wrote:

>"Gerrit P. Haase" wrote:
>> 
>> Matthew O. Persico schrieb am 2001-09-12, 18:52:
>> 
>> >I have a /usr/X11R6 directory that I wanted to get out of the way. So I
>> >renamed it like this:
>> >
>> >cd /usr
>> >mv X11R6 X11R6.XFree.4.1.0
>> >
>> >It is taking multiple minutes. Looking at it in Windows Explorer, I see
>> >both X11R6 and X11R6.XFree.4.1.0 in existance at the same time.
>> >
>> >Is mv implemented as cp and del?!?!. Why not just rename the file, a'la
>> >UNIX, or even Windows? Or am I really missing something?
>> 
>> It works as you would expect, but only if there is no file opened in the
>> dir you want to rename.
>> You can try this.
>> Create a dir and fill it up.
>> Make sure that there is no file opened and you're not looking in any
>> subdirectory with explorer or another shell window.
>> Then rename it.
>
>Wow. Who knew? Obviously not me. I have to see how UNIX (solaris 2.6 in
>partcular) behaves when I get back to work tomorrow.
>
>-- 
>Matthew O. Persico
>New York City - we're still here.
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019