coreutils
[Top][All Lists]
Advanced

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

Feature request: Make head and tail use ioctl_ficlonerange


From: Vít Novotný
Subject: Feature request: Make head and tail use ioctl_ficlonerange
Date: Sat, 1 Jun 2019 17:15:57 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hello,

with the increasing support for copy-on-write (i.e. reflink) in modern
filesystems, it seems reasonable for head(1) and tail(1) to try calling
ioctl_ficlonerange(2) where available before copying.

This way, a user can perform the following sequence of commands in bash
to obtain a single combined file without any copying:

    head -n 123 first-file   > combined-file
    head -n 456 second-file >> combined-file
    tail -n 789 third-file  >> combined-file

At first, I considered creating a separate tool for this use case, which
would be called in the following manner:

    reftk A=first-file B=second-file C=third-file cat A1-123 B1-456 C=789 
output combined-file

Then it dawned on me that this is perhaps something coreutils should be
able to do. If you think this feature request is sound, I can provide
the patches.

Best Regards,
Vit Novotny

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]