Solved

Merging two files...

Posted on 2002-04-23
19
189 Views
Last Modified: 2010-05-02
I have 2 huge files (several GB each file) on the hard disk and I would like to merge them by changing the FAT entries and EOF of the files on the partition FAT so they become one file.
I DO NOT WANT to perform a binary read of one file and append it to the other one.
Can anyone help please?

Thank you in advance.
0
Comment
Question by:BigBoss
  • 5
  • 4
  • 4
  • +3
19 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Listening & Learning
I guess this isn't possible, when memory serves me right. I had once some lessons about FAT, and i think this could only work in some specific cases (the file fills the blocks on the disk completely, ie the size of the file is an exact multiple from the block size the disk is formatted... )

If nobody can provide that answer, you might use the DOS copy command for append:
copy file1 + file2 file3

CHeers
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
hearing... (i am with angelIII)
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
I haven't done anything like that since DOS 2, but I suppose the answer is to simply change the link bytes at the end of the chain on the first file and have it point to the start of the chain in the next file, then update the length in the FAT.  I really have no clue how to do that these days, but there's probably an API call to access the FAT, and some low-level command to update disk bytes...or simply use something like Norton Utilities to change the bytes.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
You could open files in binary mode and append each other but, that doesn't guarantee that you could play the wav files...
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Richie: who is speaking of WAV files?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
:)))), wrong question!!!
I did switch questions, posting this where to be in other, and posting other here...
Sorry, sometimes is time to go to bed.
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Is this a one-time effort, or will it be ongoing?  For a one-time effort, just do the append the simple way, either what you stated ("perform a binary read of one file and append it to the other one") or as angelIII suggested (copy file1 + file2 file3)

If this will be an on-going issue, I think it is too dangerous to try to change the FAT.  For this scenario, I suggest looking into where these files come from and figure out how to merge them as they're created.
0
 

Author Comment

by:BigBoss
Comment Utility
Hello everybody....
Thank you all for your comments.
As I mentioned in my question, I don't want to use a read-and-append method.
I will wait for a couple of days...probably somebody will provide a solution.

Regards to all.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
"....
As I mentioned in my question, I don't want to use a read-and-append method.
...."
Then, why don't you use angelIII's comment?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:BigBoss
Comment Utility
>>>Then, why don't you use angelIII's comment?
Richie_Simpnetti; what is the difference between the read-and-append method and the method proposed by angell???
Do you know what does the "copy file1 + file2 file3" do???
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
I agree, BigBoss, but I hope you'll comment on my previous paragraph:

"If this will be an on-going issue, I think it is too dangerous to try to change the FAT.  For this scenario,
I suggest looking into where these files come from and figure out how to merge them as they're created."
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi BigBoss,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rspahitz's comment(s) as an answer.

BigBoss, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Author Comment

by:BigBoss
Comment Utility
DanRollins,
Thank you for your comment.
In fact, the question has not been answered.
So please delete it.
Thank you.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
BigBoss,  Thanks for returning to this question.  I see that you currently have six open Questions, some of which are getting pretty old.  Please try to finalize your open questions.

In the future, if you want to delete a question, post a 0-pt question to Community Support and ask for help.  However, for this particular question, you will not need to take any further actions -- a Moderator will take care of it within about 1 week.  I am changing my recommendation to:

   DELETE this question.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
I repeat:

...simply use something like Norton Utilities to change the bytes.

Since this generally cannot be done through Windows, you only hope is to use or write DOS app that directly access the disk hardware.

Q answered AGAIN.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
rspahitz,
If anyone is correct here it is angelIII's "It can't be done post"  Because there is no way that tweeking the FAT will work unless the file data for the first file happens to coincide with the cluster size.  That means that any FAT-manipulation technique can only be successful on average about one time in 8,000 (or 16K or 32K).
-- Dan
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 200 total points
Comment Utility
Well, it's been a while, I thought I'd done it years ago by simply changing the sector pointers.

Before I lose any credit for this, I'd like to know why BigBoss has not even responded to my comments.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Good point rspahitz, BigBoss has a clear tendancy to post many questions and then abandon them.  I've never run across such a situation before :o  You might consider adding a comment here:
http://www.experts-exchange.com/Community_Support/Q_20452887.html
-- Dan
0
 

Expert Comment

by:SpideyMod
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now