Question:
I need to run the unix 'patch' utility but I only have a windows machine. Any ideas?
anonymous
2009-07-05 02:38:27 UTC
I have to patch 2 files to upload to an apache server. but I only have ftp access. So here at home, I only have windows machines. Any ideas how I can get patch running?

Thanks.
Three answers:
exussum
2009-07-05 02:46:44 UTC
cygwin should do it.



What is it you are trying to patch ?



You can use PHP back ticks to run commands on a server




echo `uptime`;

?>



Will run the command uptime and echo the results.



EDITED



installing cygwin on your PC will allow you to do that, and ive just tried it on my server and it worked for me.




$output = `patch -b file1.php < file1.php.patch`;

echo '
' . $output . '
';

?>



running that file should patch it, providing file1.php and file1.php.patch are in the same directory.



Ive used pre formatted tags to make the output a little nicer to read.



That will create a new file as well, the -b flag makes a backup.



the backtick is located above tab if you ever need to use it again.
jplatt39
2009-07-05 04:01:09 UTC
For the future: Linux is the kernel of an Operating System which was originally created to run Unix programs on 386 machines cheaply. That means it runs patch (I ran it on the kernel this morning). Knoppix is a Linux live cd which is often used as a tool kit for both Linux and Windows machines. While you can get it freely on line, the latest version is very complicated for someone who isn't a genuine computer geek. I'll link to it in sources but go to your book store and pluck down about 40 bucks for Kyle Rankin's book Knoppix Hacks, which has a slightly older and less complicated version as a cd in back and as well has PLENTY of information about tricks like this one. Knoppix is a Swiss Army Knife of OS Utilities.
?
2009-07-05 02:41:56 UTC
Depend on the memory you have and Operation System. Next time get a Mac, trust me.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...