From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126574 invoked by alias); 12 Jan 2017 14:41:45 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 126340 invoked by uid 89); 12 Jan 2017 14:41:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*f:sk:1408535, H*i:sk:1408535, H*MI:sk:1408535, H*x:version X-HELO: msa02b.plala.or.jp Received: from msa02.plala.or.jp (HELO msa02b.plala.or.jp) (58.93.240.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jan 2017 14:41:38 +0000 Received: from msc02.plala.or.jp ([172.23.12.32]) by msa02b.plala.or.jp with ESMTP id <20170112144135.VHWC11784.msa02b.plala.or.jp@msc02.plala.or.jp>; Thu, 12 Jan 2017 23:41:35 +0900 Received: from localhost ([114.190.246.52]) by msc02.plala.or.jp with ESMTP id <20170112144135.MNYX26601.msc02.plala.or.jp@localhost>; Thu, 12 Jan 2017 23:41:35 +0900 Date: Thu, 12 Jan 2017 14:41:00 -0000 Message-Id: <20170112.234135.194683198576068158.trueroad@trueroad.jp> To: cygwin@cygwin.com, anrdaemon@yandex.ru Subject: Re: rename() cannot replace the file which is opened with writable access From: Masamichi Hosoda In-Reply-To: <1408535997.20170112083918@yandex.ru> References: <20170112.090746.2056666314950620331.trueroad@trueroad.jp> <1408535997.20170112083918@yandex.ru> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; msa02m; Thu, 12 Jan 2017 23:41:35 +0900 X-SW-Source: 2017-01/txt/msg00118.txt.bz2 >> I've found that rename() cannot replace the file >> which is opened with writable access on Cygwin. >> On Linux, it works. > > It is OS dependent behavior, and vary even on same OS. > Windows may let you rename a file, or may not, depends on how exactly it is > opened. Thank you for your answer. If I understand correctly, POSIX behavior should be able to replace the writable opened file by rename(). But, It does not work on my Cygwin environment. Is it no problem if Cygwin's behavior is different from POSIX behavior? If so, we need different application handling for Cygwin and POSIX. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple