[CentOS] Antwort: patching from different directory

Fri Sep 11 08:48:12 UTC 2009
Frank.Brodbeck at klingel.de <Frank.Brodbeck at klingel.de>

Hi

Carlos Santana <neubyr at gmail.com>  schrieb am 10.09.2009 20:04:02:

> Howdy,
> 
> I have a diff file in my /var/tmp and would like to apply patch to a
> file in a different directory (other than /va/tmp). I tried using
> patch with -d switch, but that doesn't work. It complains abt  'patch:
> **** Can't open patch file tilda.diff : No such file or directory'. Do
> I need to copy my diff file to the directory where original file
> resides? Or is there any other way round?

The exact command you executed would've been nice. -d should work
and so it does for me (though this particular usecase is on an OpenBSD
box). If you haven't already tried it do the following from anywhere on 
your system:

patch -d /other/dir -i /var/tmp/tilda.diff -p0

I'm not sure if the order of the options matters, so you might have
to consult patch(1).

Please test the above patch command and report back as I'd say it is
a bug if it doesn't work. If it didn't work please also post the full
patch command and the output of head -5 /var/tmp/tilda.diff

Frank.