This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: EISDIR EACCES and open in grep


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]