X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: New rename(2) function Date: Fri, 3 Aug 2007 15:25:26 +0000 (UTC) Lines: 45 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Blake byu.net> writes: > > However, there is still a bug: And another bug, involving the rename of a directory onto a broken symlink. On Linux: $ mkdir a $ ln -s b c $ mv a c/ mv: cannot overwrite non-directory `c' with directory `a' $ ./rename a c/ result -1, errno 20: Not a directory But on cygwin: $ mkdir a $ ln -s b c $ ./rename a c/ result 0, errno 0: No error $ ls -Fd ? b/ c@ Oops - rather than detecting that resolving c/ fails because b does not exist as a directory (ENOTDIR), cygwin went ahead and moved the directory according to the symlink contents of c. I assume once you fix the above problem, that the following testcase will then match linux' behavior: $ ln -s d d $ ./rename a d/ result -1, errno 20: Not a directory rather than cygwin's current ELOOP behavior, which doesn't make sense, since d/ was not a valid pathname to be detecting a loop with. $ ln -s d d $ ./rename a d/ result -1, errno 92: Too many levels of symbolic links -- Eric Blake -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/