Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to copy file in C?

Status
Not open for further replies.

rahul_sanghavi

Member level 2
Member level 2
Joined
Dec 7, 2004
Messages
47
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,286
Activity points
404
copy file in c

Hi

I want to copy .doc, .xls & image file into another same file in C.

Is there any rules for this?

Regards
 

c copy file

No exact rules, as long as you make exact binary copy of the file. You can use the following steps:
1. Open the source file in binary mode with fopen(... rb ).
2. Open the new file buffer, i.e. destination file with fopen(... wb).
3. Copy the contents by utilizing the file handle from step 1 and 2. You can use read(...) and write(...) or other C library function for that.

goodluck :wink:
 

copy file c

Hi,

If i follow ur instruction for copy file in c. but it's work for .txt only but if i copy .doc or .xls etc. file than this file cannot copy properly.

Regards
 

file copy in c

hi,
which platform u r programming?
if u r use windows u can use from it's API for it
(CopyFile & CopyFileEx)
and in pure C u can use fread and fwrite but u should use "rb" and "wb" for opening files. if want i send u source code.
 
copy a file in c

Oh wow!!

It's work!!!

Thanks


Regards
Rahul Sanghavi
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top