locked
_access function does not support single quote path

    Question

  • Hi,

    In my code I am using _access() function to know for existence of the file. When given with double quote it works correctly but with single quote it says file not found. Has anybody seen this? I tried it on Windows 2003 server (x64) and Windows 2008 R2 server (x64).

    Is this is known issue? Is there any solution for this apart from removing single quote in the path? 

    Thanks in advance.

    Regards,

    ~Vijay

    Friday, September 30, 2011 1:36 PM

All replies

  • Hi Vijay,

    I tried to repro with the following snippet:

       if( (_access( "d:\\vsplay\\test'1.txt", 0 )) != -1 )
        {
            printf_s( "File crt_ACCESS.C exists.\n" );

        }


    Do you have a snippet of code that you can share that demonstrates the issue?

    thanks!
    mike

    Friday, September 30, 2011 5:48 PM
    Moderator