Problem with fopen_s

Discussions about using Windows guests in VirtualBox.
Post Reply
Dave62
Posts: 1
Joined: 8. Jan 2010, 19:44
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: XP

Problem with fopen_s

Post by Dave62 »

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!
Post Reply