@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: freopen tries to close any file already associated with the stream given as third parameter and disassociates it. Then, whether that stream was successfuly closed or not, freopen opens the file whose name is passed in the first parameter, filename, and associates it with the specified stream just as fopen would do using the mode value specified as the second parameter. !!!!C# Signature: [DllImport("msvcrt.dll", SetLastError=true)] static extern TODO freopen(TODO); !!!!VB Signature: Declare Function freopen Lib "msvcrt.dll" (ByVal filename As String, ByVal mode As String, ByVal stream As IntPtr) As IntPtr !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: Mode can be any of the following: * "r" - Open a file for reading. The file must exist. * "w" - Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file. * "a" - Append to a file. Writing operations append data at the end of the file. The file is created if it does not exist. * "r+" - Open a file for update both reading and writing. The file must exist. * "w+" - Create an empty file for both reading and writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file. * "a+" - Open a file for reading and appending. All writing operations are performed at the end of the file, protecting the previous content to be overwritten. You can reposition (fseek, rewind) the internal pointer to anywhere in the file for reading, but writing operations will move it back to the end of file. The file is created if it does not exist. !!!!Tips & Tricks: Please add some! !!!!Sample Code: Please add some! Documentation: freopen@msdn on MSDN
Edit msvcrt.freopen
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.