From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22748 invoked by alias); 22 Feb 2012 02:12:57 -0000 Received: (qmail 22561 invoked by uid 22791); 22 Feb 2012 02:12:56 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from sitemail3.everyone.net (HELO imta-38.everyone.net) (216.200.145.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Feb 2012 02:12:42 +0000 Received: from pps.filterd (m0004959 [127.0.0.1]) by imta-38.everyone.net (8.14.4/8.14.4) with SMTP id q1M2AoWM021126 for ; Tue, 21 Feb 2012 18:12:41 -0800 X-Eon-Dm: dm0220 Received: by dm0220.mta.everyone.net (EON-AUTHRELAY2 - ae188d31) id dm0220.4f334033.1c28a8 for ; Tue, 21 Feb 2012 18:12:36 -0800 X-Eon-Sig: AQMH8HNPRE8UVWmrCQIAAAAB,6828f98f189174b8b210cd97fe95185d Message-ID: <4F444F09.1090708@mvseac.com> Date: Wed, 22 Feb 2012 02:12:00 -0000 From: L Anderson User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: sed 4.2.1-1 locks files on windows References: <20120221105805.256390@gmx.net> <20120221114500.GF22597@calimero.vinschen.de> In-Reply-To: <20120221114500.GF22597@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7361,1.0.260,0.0.0000 definitions=2012-02-21_09:2012-02-21,2012-02-21,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1202210314 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 X-SW-Source: 2012-02/txt/msg00642.txt.bz2 Corinna Vinschen wrote: > On Feb 21 11:58, cygwin.com@munub.e4ward.com wrote: >> see here: http://stackoverflow.com/questions/9368783/cygwin-bash-sed-locks-my-files >> >> When I change files in cygwin bash with the sed command, the file gets locked. >> >> Reproduce: >> >> Open cmd and cd to non-user directory (f.e. temp) >> echo aaa> test.txt >> Open in texteditor, add line, try to save => works >> %CYGWIN_HOME%\bin\bash -c "sed -i 's/aaa/bbb/' test.txt >> In texteditor, add another line and try to save => "Access denied" > > I just had a quick look into the aforementioned thread on stackoverflow. > The answers are a bit off the track. The problem here is that you mix > Windows and Cygwin tools in a directory with weird default permissions > which don't translate nicely to POSIX permissions. > > Here's what happens: > > - cmd's echo will create the file with default inherited Windows > permission bits. These permission bits don't make a lot of sense > from a POSIX point of view. That's where the ---------+ permissions > come from. That doesn't mean that you have no permissions! Note > the + at the end which means, there's an ACL with additional > permissions attached to the file. Use getfacl(Cygwin) or cacls(Windows) > to print the extra ACEs. NB: On Win 7 one is informed-- "NOTE: Cacls is now deprecated, please use Icacls." Regards, LA -- 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