--- Dmitry Timoshkov <[EMAIL PROTECTED]> wrote:
> Apparently a returned info should be based on whether a file handle
> resembles an ordinary disk based file, or pipe, or device, or something
> else. But that's a target for a separate patch.

Got it.  How's this?
--Juan


                
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/file.c,v
retrieving revision 1.73
diff -u -r1.73 file.c
--- dlls/msvcrt/file.c	3 Nov 2004 22:17:05 -0000	1.73
+++ dlls/msvcrt/file.c	5 Dec 2004 08:42:21 -0000
@@ -994,7 +994,18 @@
     msvcrt_set_errno(ERROR_INVALID_PARAMETER);
     return -1;
   }
-  FIXME(":dwFileAttributes = %ld, mode set to 0\n",hfi.dwFileAttributes);
+  dw = GetFileType(hand);
+  buf->st_mode = S_IREAD;
+  if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
+    buf->st_mode |= S_IWRITE;
+  if (hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+    buf->st_mode |= S_IFDIR;
+  else if (dw == FILE_TYPE_CHAR)
+    buf->st_mode |= S_IFCHR;
+  else
+    buf->st_mode |= S_IFREG;
+  TRACE(":dwFileAttributes = 0x%lx, mode set to 0x%x\n",hfi.dwFileAttributes,
+   buf->st_mode);
   buf->st_nlink = hfi.nNumberOfLinks;
   buf->st_size  = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow;
   RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw);

Reply via email to