If I want to concatenate two very large files residing on the same filesystem, say ext3 or ext4 for example, does linux provide an api to do it programmatically by reading and modifying the inode direct/indirect pointers of the two files, and modifying the filesize and superblock values? If so, is there any documentation on the api/headerfiles for that?
Note: I am aware of built in linux binaries like cat, tee, etc which could be used, but my question is about programmatically achieving this.