Solved

Merging two files...

Posted on 2002-04-23
19
190 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]
ID: 6962606
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
ID: 6963156
hearing... (i am with angelIII)
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6963935
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
ID: 6963966
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]
ID: 6964812
Richie: who is speaking of WAV files?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6965659
:)))), 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
ID: 6966094
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
ID: 6970781
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
ID: 6971304
"....
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:BigBoss
ID: 6979785
>>>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
ID: 6980969
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
ID: 7660713
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
ID: 7738826
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
ID: 7738959
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
ID: 7742583
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
ID: 7744014
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
ID: 7750586
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
ID: 7754293
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
ID: 7755386
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

919 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

18 Experts available now in Live!

Get 1:1 Help Now