C++ "system" call 
Author Message
 C++ "system" call

I need to utilize the "system" call to move a file from a
local host directory to a network drive.  However, I'm getting the
MS Dos window displayed while the system call is executing.

Is there a way to make this call without having the MS Dos
window come up?  

Also, I tried using "rename" and "move" calls without sucess.

Here's a code snipet of what I'm doing currently:

for (i = 0; i < NumBitMaps; i++)
{
    sprintf(mLocName, "%s_%d.tif", TestName, i);

    if (pTestBitMaps[i] != NULL)
    {
        WriteTiff(mLocName, pTestBitMaps[i]);

        // Now copy the file to its destination
        sprintf(mNetFile, "copy %s %s\\%s",                                                                                          
                mLocName, mFullPath, mLocName);

        mRC = system(mNetFile);
        remove(mLocName);
    }

Quote:
}

Any help would be greatly appreciated.

Thanks,

Connie Emmart



Tue, 01 Aug 2000 03:00:00 GMT  
 C++ "system" call

Look at the Win32 CopyFile and CopyFileEx APIs.

HTH

: I need to utilize the "system" call to move a file from a
: local host directory to a network drive.  However, I'm getting the
: MS Dos window displayed while the system call is executing.
:
: Is there a way to make this call without having the MS Dos
: window come up?  
:
: Also, I tried using "rename" and "move" calls without sucess.
:
: Here's a code snipet of what I'm doing currently:
:
: for (i = 0; i < NumBitMaps; i++)
: {
:     sprintf(mLocName, "%s_%d.tif", TestName, i);
:
:     if (pTestBitMaps[i] != NULL)
:     {
:       WriteTiff(mLocName, pTestBitMaps[i]);
:
:       // Now copy the file to its destination
:       sprintf(mNetFile, "copy %s %s\\%s",                                                                                          
:               mLocName, mFullPath, mLocName);
:
:       mRC = system(mNetFile);
:       remove(mLocName);
:     }
: }
:
: Any help would be greatly appreciated.
:
: Thanks,
:
: Connie Emmart

--
--
/*  Andrew  */
WWW: http://www.halcyon.com/ast        



Tue, 01 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. directing unix system call "system"s output

2. "system()" system call

3. Q: Return-values of system("...") calls

4. Running system calls "silently"

5. Calling a web service from "C", not C++

6. System call "select( )" and "Message Queue"

7. about "call by value" and "call by reference"

8. "c" calling Fortran, and Fortran calling "c"

9. "system" could not be found

10. where to get namespace "System.Configuration"?

11. remove() vrs fopen("""w")

12. q: reading wmi produces "System.UnauthorizedAccessException"

 

 
Powered by phpBB® Forum Software