commit 5477e8fdd7bd4a14c0cfd0a524df94882c60c8b4
parent 82f96cc1d663ffd6059bafa2be44f35a3f3b6c43
Author: Alexander Burger <abu@software-lab.de>
Date: Fri, 15 Apr 2011 13:22:00 +0200
Moved runtime files (tmp, led history) to ~/.pil/
Diffstat:
11 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,6 +1,7 @@
* XXjun11 picoLisp-3.0.7
64-bit version for PowerPC (ppc64)
- Changed "@.picoHistory" to ".pilHistory"
+ Moved temporary directories to ~/.pil/tmp/
+ Moved line editor history to ~/.pil/history
* 29mar11 picoLisp-3.0.6
Bug in 'poll' (64-bit)
diff --git a/ReleaseNotes b/ReleaseNotes
@@ -1,9 +1,20 @@
-14apr11abu
+15apr11abu
(c) Software Lab. Alexander Burger
Release Notes for picoLisp-3.0.7
================================
-1. A preliminary implementation of the 64-bit version for PowerPC (ppc64).
+1. Runtime files, like the line editor history and temporary directories, were
+ moved to a ".pil/" directory in the user's home directory. The reason is that
+ for a global installation of PicoLisp, neither the installation directory nor
+ the current working directory can be assumed to be writable.
+
+ The line editor history used to reside in the installation directory, in the
+ file "@.picoHistory". It is now in "~/.pil/history".
+
+ Temporary directories (with the PID as name) were created in a "tmp/"
+ directory in the current working directory. They are now in "~/.pil/tmp/".
+
+2. A preliminary implementation of the 64-bit version for PowerPC (ppc64).
Doesn't run yet, but will hopefully improve until this release is due.
diff --git a/doc/refT.html b/doc/refT.html
@@ -20,9 +20,9 @@ href="refB.html#*Bye">*Bye</a></code>.
: *Bye
-> ((saveHistory) (and *Tmp (call 'rm "-r" *Tmp)))
: (tmp "foo" 123)
--> "tmp/27140/foo123"
+-> "/home/app/.pil/tmp/27140/foo123"
: *Tmp
--> "tmp/27140/"
+-> "/home/app/.pil/tmp/27140/"
</code></pre>
<p><dt><a name="*Tsm"><code>*Tsm</code></a>
@@ -383,8 +383,8 @@ href="ref_.html#$tim">$tim</a></code>.
<dt><a name="tmp"><code>(tmp ['any ..]) -> sym</code></a>
<dd>Returns the path name to the <code><a
href="refP.html#pack">pack</a></code>ed <code>any</code> arguments in a
-process-local temporary directory. The directory name consists of "tmp/"
-followed by the current process ID <code><a
+process-local temporary directory. The directory name consists of the path to
+"tmp/" in the user's home directory, followed by the current process ID <code><a
href="refP.html#*Pid">*Pid</a></code>. This directory is automatically created
if necessary, and removed upon termination of the process (<code><a
href="refB.html#bye">bye</a></code>). See also <code><a
@@ -392,14 +392,10 @@ href="refT.html#*Tmp">*Tmp</a></code> and <code><a
href="refB.html#*Bye">*Bye</a></code> .
<pre><code>
-: *Bye
--> ((saveHistory) (and *Tmp (call 'rm "-r" *Tmp)))
: *Pid
-> 27140
: (tmp "foo" 123)
--> "tmp/27140/foo123"
-: (dir "tmp/")
--> ("27140")
+-> "/home/app/.pil/tmp/27140/foo123"
: (out (tmp "foo" 123) (println 'OK))
-> OK
: (dir (tmp))
diff --git a/doc/tut.html b/doc/tut.html
@@ -186,7 +186,7 @@ expression when the cursor is at a left parenthesis.
<li>Lines shorter than 3 characters, lines beginning with a space character, or
duplicate lines are not entered into the history.
-<li>The history is stored in a file named ".pilHistory" in the current working
+<li>The history is stored in the file ".pil/history" in the user's home
directory. The length of the history is limited to 1000 lines.
</ul>
diff --git a/ersatz/lib.l b/ersatz/lib.l
@@ -1,4 +1,4 @@
-# 25feb11abu
+# 15apr11abu
# (c) Software Lab. Alexander Burger
############ lib.l ############
@@ -141,11 +141,16 @@
(unless (idx '*Once (file) T)
(run Prg 1) ) )
+(de pil @
+ (when (== "Pil" '"Pil")
+ (call 'mkdir "-p" (setq "Pil" `(pack (sys "HOME") "/.pil/"))) )
+ (pass pack "Pil") )
+
# Temporary Files
(de tmp @
(unless *Tmp
(push '*Bye '(call 'rm "-r" *Tmp))
- (call 'mkdir "-p" (setq *Tmp (pack "tmp/" *Pid "/"))) )
+ (call 'mkdir "-p" (setq *Tmp (pil "tmp/" *Pid "/"))) )
(pass pack *Tmp) )
### List ###
diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar
Binary files differ.
diff --git a/lib.l b/lib.l
@@ -1,4 +1,4 @@
-# 25feb11abu
+# 15apr11abu
# (c) Software Lab. Alexander Burger
(de task (Key . Prg)
@@ -157,6 +157,11 @@
(unless (idx '*Once (file) T)
(run Prg 1) ) )
+(de pil @
+ (when (== "Pil" '"Pil")
+ (call 'mkdir "-p" (setq "Pil" `(pack (sys "HOME") "/.pil/"))) )
+ (pass pack "Pil") )
+
(de rc (File Key . @)
(ctl File
(let Lst (in File (read))
@@ -186,7 +191,7 @@
(unless *Tmp
(push '*Bye '(call 'rm "-r" *Tmp))
(push '*Fork '(off *Tmp) '(del '(call 'rm "-r" *Tmp) '*Bye))
- (call 'mkdir "-p" (setq *Tmp (pack "tmp/" *Pid "/"))) )
+ (call 'mkdir "-p" (setq *Tmp (pil "tmp/" *Pid "/"))) )
(pass pack *Tmp) )
### List ###
diff --git a/lib/led.l b/lib/led.l
@@ -1,4 +1,4 @@
-# 14apr11abu
+# 15apr11abu
# (c) Software Lab. Alexander Burger
# Line editor
@@ -23,7 +23,7 @@
"HistMax" 1000 # History limit
"History" # History of input lines
- (in "+.pilHistory"
+ (in (pack "+" (pil "history"))
(ctl NIL
(make (until (eof) (link (line T)))) ) )
"Hist0" "History" )
@@ -401,10 +401,10 @@
(pack "Line") ) )
(de saveHistory ()
- (in "+.pilHistory"
+ (in (pack "+" (pil "history"))
(ctl T
(let (Old (make (until (eof) (link (line T)))) New "History" N "HistMax")
- (out ".pilHistory"
+ (out (pil "history")
(while (and New (n== New "Hist0"))
(prinl (pop 'New))
(dec 'N) )
diff --git a/man/man1/picolisp.1 b/man/man1/picolisp.1
@@ -1,4 +1,4 @@
-.\" 08mar11abu
+.\" 15apr11abu
.\"
.TH PICOLISP 1 "" "" "User Commands"
.SH NAME
@@ -74,6 +74,12 @@ pil +
.RE
.P
The interpreter can be terminated by typing Ctrl-D or (bye).
+.SH FILES
+Runtime files are maintained in the ~/.pil directory:
+.IP ~/.pil/tmp/<pid>/
+Process-local temporary directories
+.IP ~/.pil/history
+The line editor's history file
.SH BUGS
.B PicoLisp
doesn't try to protect you from every possible programming error ("You asked for
diff --git a/src/vers.h b/src/vers.h
@@ -1 +1 @@
-static byte Version[4] = {3,0,6,3};
+static byte Version[4] = {3,0,6,4};
diff --git a/src64/version.l b/src64/version.l
@@ -1,6 +1,6 @@
-# 14apr11abu
+# 15apr11abu
# (c) Software Lab. Alexander Burger
-(de *Version 3 0 6 3)
+(de *Version 3 0 6 4)
# vi:et:ts=3:sw=3