Problem with fopen_s
Posted: 8. Jan 2010, 19:56
Hello,
I'm using VirtualBox 3.1.2. Host is Windows 7x64. Guest is Windows XP with Guest Additions. All OSes have latest updates.
Recently I discovered a problem in some C source code. The problem occurs when attempting to perform an fopen_s() from within the guest to a shared drive on the host.
I found these functions work ok:
stream=fopen( filename, "at" );
fopen_s( &stream, filename, "a+t");
But, this function doesn't work properly:
fopen_s( &stream, filename, "at" ); <= note this is "at" while the function that works is "a+t"
The return value from this function indicates success and subsequent fprintf() and fwrite() also indicate success. But, the file itself is never updated.
I'm using VS2005 with latest updates.
This seems like a bug in Guest Additions or maybe fopen_s() ?
Thanks!
I'm using VirtualBox 3.1.2. Host is Windows 7x64. Guest is Windows XP with Guest Additions. All OSes have latest updates.
Recently I discovered a problem in some C source code. The problem occurs when attempting to perform an fopen_s() from within the guest to a shared drive on the host.
I found these functions work ok:
stream=fopen( filename, "at" );
fopen_s( &stream, filename, "a+t");
But, this function doesn't work properly:
fopen_s( &stream, filename, "at" ); <= note this is "at" while the function that works is "a+t"
The return value from this function indicates success and subsequent fprintf() and fwrite() also indicate success. But, the file itself is never updated.
I'm using VS2005 with latest updates.
This seems like a bug in Guest Additions or maybe fopen_s() ?
Thanks!