[CM] CM Events files in /tmp

B. Battey bbattey@u.washington.edu
Wed, 16 Oct 2002 18:34:45 -0700 (PDT)

Hi Rick,

Getting ramped up to start handing CM code examples to class this week and
found some unexpected behavior in CM that throws us for a loop.

running on ACL/Linux:

[1] CM(15): (cm-version)
"Common Music 2.3.4"

One thing we've talked about before... in previous CM versions, CM running
under linux would always write its output to the ACL PWD unless you
designated otherwise. This makes life so very easy for teaching a group
class on a multi-user system. A student places a code example in a
directory of his or her choice, starts lisp, runs the example, and the
.sco file appears in that directory. You want to check their code? You
make a copy to your directory, run the code, and zap, there's the output.
No fiddling with pathnames. Then you can immediately run a csound job
without having to designate paths for any of the files required.

(Of course, this all is not possible on Mac OS9 / MCL)

Sounds like whatever version of CM was being used last year while I was in
India wrote to people's home directory by default. Not as nice as PWD, but
reasonable. (Or maybe this was a patch that Don wrote?)

Now, however, the default is to write to /tmp, which means students would
then have to copy stuff out of /tmp into their own directories. But that
adds to the confusion early non-programmers are already dealing with, plus
creates extra steps that really shouldn't be necessary.

Now, we could re-write our examples to have events lines that write to,
say "~/examp1.sco". That would be better than going to /tmp.

Or we could use the "use-pwd" function that I wrote 2 yrs back and imbed
it in every code example (would rather not, though).

But neither will work now. Here's what's happening:

CM(9): (events (simplest-0) "~/simplest-0.sco"
	:header "f1 0 16384 10 1"
	:handler nil)
CM(10): (events (simplest-0) "~bbattey/simplest-0.sco"
	:header "f1 0 16384 10 1"
	:handler nil)
CM(11): (events (simplest-0) "/Users/battey/simplest-0.sco"
	:header "f1 0 16384 10 1"
	:handler nil)
(events (simplest-0) (merge-pathnames "/Users/battey/simplest-0.sco")
	:header "f1 0 16384 10 1"
	:handler nil)

Now, one can do this:
(set-cm-host-dir "tmp;*.*" "~/*.*")

But then files will always write to the user's home directory regardless
of the pathname given. Though this is a step in the right direction...

Guess I'll have to teach students to grab-from-tmp or from home until a
fix ;-)

I know compatibility with Mac and other systems is an issue, but having a
flag or some other means to have Events write to PWD when the system used
has a PWD would be a beautiful thing. And allowing a provided path to
overide the default path.


Bret Battey                                     http://BatHatMedia.com
Research Associate
Center for Digital Arts and Experimental Media
University of Washington, Seattle    http://www.washington.edu/dxarts/