Re: amber-developers: Re: PMEMD 10 patch 2

From: Gustavo Seabra <gustavo.seabra.gmail.com>
Date: Fri, 3 Oct 2008 09:02:01 -0400

On Thu, Oct 2, 2008 at 6:07 PM, David A. Case <case.biomaps.rutgers.edu> wrote:
> Does anyone know how to make a patch file that adds a file (rather than
> updating an existing file?)

I think that's useful for everyone here:

You can create a patch that creates a new file by diffing the
/dev/null with the file you want to create. For example:

$ mkdir test
$ cd test
$ echo "this is the test file" > test_file
$ diff -Naur /dev/null test_file > patch1
$ cat patch1
--- /dev/null 2008-09-28 09:24:59.428174791 -0400
+++ test_file 2008-10-03 08:57:52.000000000 -0400
.. -0,0 +1 ..
+This is the test file.
$ rm test_file
$ ls
patch1
$ patch -N < patch1
patching file test_file
$ ls
patch1 test_file
$ cat test_file
This is the test file.

Gustavo.
Received on Sun Oct 05 2008 - 05:07:16 PDT
Custom Search