[plt-scheme] v299: process* file args, paths, strings, and byte-strings

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Tue Oct 19 18:33:08 EDT 2004

Evening, all.

I'm a little confused about exactly how process*, paths, strings, and
byte strings all interact in v299, and I'm hoping someone can clarify.

Here's the context:

(for-each
  (lambda (deb)
    (let-values ([(stdin stdout pid stderr ctrl-proc)
                  (process* "/sw/bin/dpkg" "-I" deb)])
      ...))
  (directory-list "/sw/fink/debs"))

So, directory-list returns a list of paths, and process* expects string
arguments.  I know about path->byte-string and path->string, but I'm not
sure whether they all work together to give me the behavior I want.  If
I use path->byte-string, process* complains because it gets an
unexpected argument.  If I use path->string, then it's not at all clear
how this is interpreted by process*.

In this particular situation, I'll almost certainly be fine, because I
don't expect /sw/fink/debs to contain any files with names not
representable in basic ASCII, but I'm anal^H^H^H^H careful enough to
want to get this right in the general case.

What's the right thing to do here?  Or should process* be modified to
allow byte-strings as arguments?

Thanks,

Richard


Posted on the users mailing list.