Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copying a File in turboc c++3.00

Posted on 1998-11-22
3
Medium Priority
?
204 Views
Last Modified: 2010-04-01
How to copy one file from one directory to another directory
through a program in turbo c++ 3.00 ?
Kindly reply fast as its very urgent.
Thanks.
0
Comment
Question by:nitin_kumars
3 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 400 total points
ID: 1178416
Use the system command
system ("copy \\dir1\\file1 \\dir2\\file2");

0
 

Author Comment

by:nitin_kumars
ID: 1178417
The System Command does not work on the system. It Gives An error saying -1. It Was very quick of you to reply. Kindly reply soon again but with an example. I'll wait for the reply till late night so please be fast b'cos its very very urgent.
Thanx

0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1178418
Is it for school or something?  Why do you need it so fast?

What operating system are you using?  DOS/Windows/Win95/98?  If it is any of those, the system command should work.  What is the value of the errno variable after you call system?

A return value of – 1 indicates an error, and errno is set to one of the following values:

E2BIG Argument list (which is system-dependent) is too big.

ENOENT Command interpreter cannot be found.

ENOEXEC Command-interpreter file has invalid format and is not executable.

ENOMEM Not enough memory is available to execute command; or available memory has been corrupted; or invalid block exists, indicating that process making call was not allocated properly.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question