Solved

Merging two files...

Posted on 2002-04-23
19
194 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
[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
  • 5
  • 4
  • 4
  • +3
19 Comments
 
LVL 143

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 143

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
 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

710 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