473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Copy all files of Directory into single file..

Hi everybody.
I have an idea of reading one file and write it somewhere else. Now, suppose I have five(approx.) files in some directory and if all files are required to write in single file one by one then how it is to be done?? Any suggestion pls.
Aug 16 '07 #1
3 2723
sicarie
4,677 Expert Mod 4TB
You posted in the C/C++ forum, so I'm going to assume you're trying to write a C/C++ program for that... So just keep the file output stream the same. You can open and close the file in put streams to be the five files, and then simply don't close the file output stream until all file files have been read.

This is a pretty good tutorial on File I/O, and should get you started.
Aug 16 '07 #2
[Thanks for your post....

I have Idea about what is there in the link you sent. but I dont want to read only single file. I want to read more than one files one by one and then put their contents in single file. There is some function like getnextfile() or getfilenext() to have pointer to next file. Pls suggest me in that way...

Suppose at c:\data\ I have more than one files(actually not know at runtime) and we have to make program that copies content of one file(say Packet.txt) and call getnextfile() or getfile next() to know whether we have more file in folder or not. if yeah then copy its content to file(Packet.txt)...
Aug 16 '07 #3
naivE
12
[Thanks for your post....

I have Idea about what is there in the link you sent. but I dont want to read only single file. I want to read more than one files one by one and then put their contents in single file. There is some function like getnextfile() or getfilenext() to have pointer to next file. Pls suggest me in that way...
Hey. I have had to do a few of these things in the project I am working on at the moment and they can get a little confusing. Google really comes in handy though http://www.developerfusion.co.uk/show/4359/ for example.
You should be able to use this to get started. Also, it is probably worth thinking about subfolders too as they can be a bit of a hassle. Well, for me and my limited experience anyway.

Good luck.
Aug 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Antonio Lopez Arredondo | last post by:
hi all !!! I need to copy a folder and its subfolders to another location; which class should I use ? could only find the System.IO.Directory.MOVE but don't know how to COPY. thanks in...
0
by: Tess | last post by:
Hi, Long time reader, first time poster... Any help is appreciated. I have a few questions regarding Winform controls embedded within an html page. For more info please see the appendix. Now,...
3
by: Jake | last post by:
I know how to copy files from one location to another but how would I go about copying a file from one directory into serveral - or actually all subdirectories in a single action? Some kind of...
10
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I...
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
1
by: Dan | last post by:
I have an application that I want to use for copying files. My goal is to copy a files, if a file is in use or not accessible because of security reasons I want to make note of that file then...
12
by: samoore33 | last post by:
I found a real nice article on how to copy a directory on MSDN. The only problem is that I can not figure out how to get the namespace Microsoft.VisualBasic.MyServices. I wanted to know if anyone...
1
by: dkmarni | last post by:
Hi, I am trying to do this perl script, but not able to complete it successfully. Here is the description what the script has to do.. Accept two and only two command line arguments. Again,...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.