Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(616)

Unified Diff: bin/cptmp

Issue 121043: cptmp - create a temporary file
Patch Set: Created 16 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cptmp
===================================================================
new file mode 100755
--- /dev/null
+++ b/bin/cptmp
@@ -0,0 +1,16 @@
+#!/usr/local/plan9/bin/rc
+flag e +
+
+if(~ $#TMPDIR 0)
+ TMPDIR=/tmp
+base=`{basename $1}
+tmp=$TMPDIR/$base.$USER.$pid
+
+if (test -f $1) {
+ cp -pr $1 $tmp
+}
+if not {
+ touch $tmp
+}
+chmod +wx $tmp
+echo $tmp
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b