Re: Linking two files together

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 26, 2010 at 10:16 AM, Rector, David <drector@xxxxxxxxxxxxxx> wrote:
> Hello,
>
> I have studied various filesystems, and am fairly familiar with how they are structured. However, I am currently stuck on trying to do what seems like a simple thing.
>
> I would like to join two files together without having to physically copy bytes (i.e. I have vary large files, so I don't want to use 'cat'). It seems to me that it should be possible to simply modify the file entry in the filesystem such that the last inode of the first file points to the first inode of the second file. I guess this is similar to a "hard link", but used to join files rather than simply have another pointer to one file.
>
> I have seen 'mmv' and 'lxsplit' and they all seem to do the same thing, namely they want to physically copy the bytes in order to join two files together.
>
> Is there any such utility in linux to perform such a hard link to join or connect two files together without having to copy bytes?
>
> Thanks for your help.
>
> Dave Rector
> *:^)
> --

There is no way that this can work as you might expect.
Consider the end of a file.   If the allocation block is the
common 4K bytes then the file can end at one of
4096 different byte locations.   So even if the BLOCKS could
be joined the bytes cannot.

However in use the common way to deal with this is
to cat multiple files into a pipe and have the program
read the pipe (stream).  i.e

  # cat file1 file2 file3 | program

You  can  avoid the copy of bytes in the first file
and copy then append bytes from the second file
onto the first.

  # cat file2 >> file1

Programs can open a sequence of files
one after another.  Because of this there
is seldom a need to "append" files as
you seem to want.

-- 
        NiftyFedora
        T o m   M i t c h e l l
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux