X-Recipient: archive-cygwin AT delorie DOT com 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 X-Eon-Dm: dm0220 X-Eon-Sig: AQMH8HNPRE8UVWmrCQIAAAAB,6828f98f189174b8b210cd97fe95185d Message-ID: <4F444F09.1090708@mvseac.com> Date: Tue, 21 Feb 2012 18:12:25 -0800 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 AT cygwin DOT com Subject: Re: sed 4.2.1-1 locks files on windows References: <20120221105805 DOT 256390 AT gmx DOT net> <20120221114500 DOT GF22597 AT calimero DOT vinschen DOT 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 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 Corinna Vinschen wrote: > On Feb 21 11:58, cygwin DOT com AT munub DOT e4ward DOT 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