[comp.emacs] mkdir in GNU 18.50?

mkupfer@acornrc.UUCP (Mike Kupfer) (03/07/88)

I'm writing some Emacs lisp that creates a directory and populates it
with various files.  I can't seem to find a function that creates a
directory.  The best I've been able to do is use shell-command, which
means that errors are handled by popping up a window with the error
message in it (blech).

Question #1: Am I missing something, or is 18.50 really missing a
mkdir function?

Question #2: If I really have to write my own, is there a better way to
do it in Lisp, or is shell-command the best I can do?  (I don't want to
bother writing a new primitive in C - this is as much an exercise in
learning Emacs lisp as it is an attempt to produce useful code.)

thanks,
mike
-- 
Mike Kupfer
Olivetti Research Center		      415-496-6238
orc!kupfer@unix.sri.com                       kupfer@orc.olivetti.com
{decwrl!acornrc, ames!acornrc, oliveb}!orc!kupfer     ucbvax!kupfer

wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (03/07/88)

In article <648@acornrc.UUCP> mkupfer@acornrc.UUCP (Mike Kupfer) writes:
>I can't seem to find a function that creates a directory.  The best
>I've been able to do is use shell-command, which means that errors
>are handled by popping up a window with the error message in it
>(blech).

Instead of shell-command you can try: 

     call-process:
     Call PROGRAM in separate process.
     Program's input comes from file INFILE (nil means /dev/null).
     Insert output in BUFFER before point; t means current buffer;
      nil for BUFFER means discard it; 0 means discard and don't wait.
     Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
     Remaining arguments are strings passed as command arguments to PROGRAM.
     This function waits for PROGRAM to terminate;
     if you quit, the process is killed.

This is the "raw" interface that shell-command uses.
---
Wolfgang Rupprecht	ARPA:  wolfgang@mgm.mit.edu (IP 18.82.0.114)
326 Commonwealth Ave.	UUCP:  mit-eddie!mgm.mit.edu!wolfgang
Boston, Ma. 02115	TEL:   (617) 267-4365

igb@cs.bham.ac.uk (Ian G Batten <BattenIG>) (03/09/88)

In article <648@acornrc.UUCP> mkupfer@acornrc.UUCP (Mike Kupfer) writes:
>I can't seem to find a function that creates a directory.  The best
>I've been able to do is use shell-command, which means that errors
>are handled by popping up a window with the error message in it
>(blech).

A woman here has added a mkdir function for a similar task.  She's
actually done it on VMS, but the code will be identical.  Mail
GOWER%comp-v1.bham.ac.uk@cunyvn.cuny.edu  (or ...!ukc!bhamcr!GOWER if
you must, but we'd rather you didn't) and ask for the code.

-- 
ian