Solved

Copying a File in turboc c++3.00

Posted on 1998-11-22
3
197 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 200 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

777 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