| 1 | .de VS |
| 2 | .sp 1 |
| 3 | .RS |
| 4 | .nf |
| 5 | .ft B |
| 6 | .. |
| 7 | .de VE |
| 8 | .ft R |
| 9 | .fi |
| 10 | .RE |
| 11 | .sp 1 |
| 12 | .. |
| 13 | .TH inplace 1 "5 February 2005" "Edgeware tools" |
| 14 | .SH NAME |
| 15 | inplace \- update a file in-place |
| 16 | .SH SYNOPSIS |
| 17 | .B inplace |
| 18 | .I file |
| 19 | \&... |
| 20 | .B \-\- |
| 21 | .I program |
| 22 | .RI [ arguments ...] |
| 23 | .SH DESCRIPTION |
| 24 | The |
| 25 | .B inplace |
| 26 | program rewrites files in place using filters. For each |
| 27 | .I file |
| 28 | it runs |
| 29 | .VS |
| 30 | .IR "program arguments " ... |
| 31 | .VE |
| 32 | with standard input redirected from |
| 33 | .I file |
| 34 | and redirecting standard output to |
| 35 | .IR file \c |
| 36 | .BR .new . |
| 37 | If all these programs are successful, then each |
| 38 | .I file |
| 39 | is copied to |
| 40 | .IB file .old |
| 41 | and each |
| 42 | .IB file .new |
| 43 | renamed to |
| 44 | .IR file ; |
| 45 | the |
| 46 | .IB file .old |
| 47 | files are then deleted. If something went wrong, the |
| 48 | .IB file .new |
| 49 | files are all deleted and the original |
| 50 | .IR file s |
| 51 | are left unmodified. |
| 52 | .I program |
| 53 | exits successfully, |
| 54 | .B inplace |
| 55 | will rename the newly-written |
| 56 | .IB file .new |
| 57 | to simply |
| 58 | .I file |
| 59 | and exit zero; otherwise it deletes |
| 60 | .IB file .new |
| 61 | and exits the same as |
| 62 | .I program |
| 63 | did. |
| 64 | .SH BUGS |
| 65 | Doesn't exit correctly if subprogram was killed by a signal. The update |
| 66 | isn't completely perfect but it's very good; it can leave debris lying |
| 67 | around if strange things happen during the renaming. |
| 68 | .SH AUTHOR |
| 69 | Mark Wooding <mdw@distorted.org.uk> |