mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Change the way batch files and output files are opened. They now allow write and delete while being excuted. This is how MS cmd is done. Thanks to Greatlord, Filip, Thomas.
svn path=/trunk/; revision=17450
This commit is contained in:
@@ -219,9 +219,9 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||
{
|
||||
HANDLE hFile;
|
||||
SetLastError(0);
|
||||
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_WRITE_THROUGH, NULL);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("Batch: (\'%s\', \'%s\', \'%s\') hFile = %x\n"),
|
||||
|
||||
@@ -780,9 +780,9 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||
/* we need make sure the LastError msg is zero before calling CreateFile */
|
||||
SetLastError(0);
|
||||
|
||||
hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE, &sa,
|
||||
hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, &sa,
|
||||
(nRedirFlags & OUTPUT_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user