Solved

Copying a File in turboc c++3.00

Posted on 1998-11-22
3
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

739 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