Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Fri, 10 May 2002 13:55:43 -0400 (EDT) From: Mark Blackburn To: cygwin AT cygwin DOT com Subject: Re: EISDIR EACCES and open in grep Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Well so far I have two solutions to this recursive grep on Windows 98 problem: 1) The patch I submitted earlier here it is again relative to the 1.3.10-1 version of cygwin: --- fhandler.cc.bak Tue Feb 19 22:25:00 2002 +++ fhandler.cc Thu May 9 10:18:40 2002 @@ -409,7 +409,26 @@ if (GetLastError () == ERROR_INVALID_HANDLE) set_errno (ENOENT); else - __seterrno (); + { + if (GetLastError () == ERROR_ACCESS_DENIED) + { + WIN32_FIND_DATA find_file_data; + if (INVALID_HANDLE_VALUE != FindFirstFile(get_win32_name (), + &find_file_data)) + { + if (FILE_ATTRIBUTE_DIRECTORY == + find_file_data.dwFileAttributes) + set_errno (EISDIR); + } + else + { + SetLastError (ERROR_ACCESS_DENIED); + __seterrno (); + } + } + else + __seterrno (); + } goto done; } OR 2) Compile grep with the HAVE_DIR_EACCES_BUG flag enabled. I've tested these both on Windows 98. I have no idea what these changes would do to NT/2000 however. BTW: thanks to Chris Faylor for helping with the cygwin1.dll compile -- 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/