BUG: OpenFile Fails in Windows 95 When Using a Relative Path |
Q183344
In Windows 95, if you run a Win32 program, change the process directory to the parent or some other ancestor directory, and then use OpenFile() to open a file in the original process directory using a minimum relative path, it will always fail with ERROR_FILE_NOT_FOUND.
On Win32 platforms, you need to use CreateFile() to open a file. If you are using OpenFile() for cross-platform compatibility, the function should be supplied with a full path or a better qualified path (that is, one that begins with a period).
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
OpenFile( "DEBUG\\TEST.TXT", ... )
This call fails with ERROR_FILE_NOT_FOUND. A call to GetCurrentDirectory()
correctly returns C:\Temp.
OpenFile( ".\\DEBUG\\TEST.TXT", ... )
Additional query words:
Keywords : kbAPI kbKernBase kbGrpDSKernBase
Issue type : kbbug
Technology : kbAudDeveloper kbWin32sSearch kbWin32API
|
Last Reviewed: December 16, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |