Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Node:Creating and Removing, Next:, Previous:Imperfect, Up:Merging with patch

Creating and Removing Files

Sometimes when comparing two directories, a file may exist in one directory but not the other. If you give diff the -N or --new-file option, or if you supply an old or new file that is named /dev/null or is empty and is dated the Epoch (1970-01-01 00:00:00 UTC), diff outputs a patch that adds or deletes the contents of this file. When given such a patch, patch normally creates a new file or removes the old file. However, when conforming to POSIX (see patch and POSIX), patch does not remove the old file, but leaves it empty. The -E or --remove-empty-files option causes patch to remove output files that are empty after applying a patch, even if the patch does not appear to be one that removed the file.

If the patch appears to create a file that already exists, patch asks for confirmation before applying the patch.

  Published under the terms of the GNU General Public License Design by Interspire