Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!wuarchive!usc!elroy.jpl.nasa.gov!ncar!noao!arizona!dave From: dave@cs.arizona.edu (Dave P. Schaumann) Newsgroups: comp.unix.questions Subject: Changing .zoo archive to .lzh archive: help! Keywords: Unique directory names Message-ID: <885@caslon.cs.arizona.edu> Date: 17 Feb 91 03:41:17 GMT Distribution: usa Organization: U of Arizona CS Dept, Tucson Lines: 33 I am trying to write a script that will allow me to convert zoo archives to lharc archives under Unix. Here's what I have so far: mkdir xxx cd xxx zoo xq// ../$1.zoo lharc aq ../$1.lzh * `no-dot .*` cd .. rm -r xxx Where "no-dot" is a simple program that echos back everything in argv[] that isn't "." or ".." This works fine, except for two problems: first, there might already be a file called "xxx" in the current directory, and second, I can't have more than one invocation going at once. Now, I could write a program to generate a temporary directory name using getpid() and some unlikely template, like "xx-######-temp". What I need to know is: 1. Is it a reasonable assumption that no two concurrent getpid()'s will return the same value? 2. Is there a better way to do this? Thanks in advance for all replies. -- Dave Schaumann | DANGER: Access holes may tear easily. Use of the access | holes for lifting or carrying may result in damage to the dave@cs.arizona.edu | carton and subsequent injury to the user.