Link to home
Start Free TrialLog in
Avatar of colmstea
colmstea

asked on

Splitting/merging files in ext2 linux file system

I need to know how (if there is a way, programatically or via command line) to merge two files in linux.  I DO NOT MEAN A SIMPLE 'CAT' (which involves copying and significant disk operations).  I mean changing the file system's table so that the end of one file simple leads to the beginning of what used to be another file.  Hmm. This is tough to explain.  

When you use 'mv' to move a file in the linux operating system, it is instantaneous and involves no copying.  Its a simple modification of the ext2 file system table.  I want to be able to do a similar operation except with splitting/merging files.

Is this even possible?

thanks

colmstea
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sciuriware
sciuriware

Merge = inserting lines between others.
There is a merge option in 'sort'.
Otherwise there is no use for what you ask.

Do you have any idea why you asked this question anyhow?

;JOOP!
Avatar of colmstea

ASKER

sciruiware: Its hard to explain the application, but trust me: I know why I asked the question.. ??????? Also:  This isnt a text file. I mean that I wanted to split a binary (500+meg) file into two files and possibly append one of the file parts (which could be huge..) to the end of another file.  Since this is a real-time system I wanted it to be very fast and not involve copy operations on the disk.  

Anyways, ravenpl:  I appreciate the reply regarding the impossibility of handling these split/append operations on a file system level.  Since part of my question was whether it was possible, and since you seemed to understand what I was asking I am awarding you the 500 points.  

If you think of anything (hack/workaround) later, feel free to reply though!!

Thanks,

colmstea
> If you think of anything (hack/workaround) later, feel free to reply though!!
I would say it this way:
For filesystems I know well (ext2/3 reiserfs vfat) it's impossible for sure.
For filesystems I don't know it's internals (like xfs, jfs) i'm not sure, but I would not expect (becouse filesystems have similar disk allocation strategies).
Avatar of Julian Parker
Apologies for butting in...

would the `split` utility do what you want?

I guess the performance would depend on hardware.


check out `man split`


Jools