bug-gnu-utils
[Top][All Lists]
Advanced

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

GNU patch empty unreadable files


From: Andreas Gruenbacher
Subject: GNU patch empty unreadable files
Date: Thu, 19 Mar 2009 11:55:53 +0100
User-agent: KMail/1.9.9

Hello,

when patch applies a diff which creates a new file and the --backup option is 
given, it creates an empty file with mode 0:

    $ diff -u /dev/null /etc/hosts > hosts.diff
    $ patch --backup hosts < hosts.diff
    patching file hosts
    $ ls -l hosts.orig
    ---------- 1 agruen users 0 2009-03-19 11:53 hosts.orig

Those backup files are harmful beause they trip up other programs.

The repository history doesn't indicate why patch is doing this; it might be 
to distinguish backups of empty files from backups of file creates though. Is 
anything making use of this distinction? Otherwise, can we create those 
backup files with the default mode instead?

Thanks,
Andreas




reply via email to

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