USER command questions (Fairlight)

John Esak john at valar.com
Fri Sep 11 11:24:56 PDT 2009


If you're going to use opehdir() as you say with SYSTEM, then do yourself
ahother favor and get rid of the NeXTDIR.. Why "execute" that command for
every file in the folder, when all you have to do is increment a counter and
it automaticlly points to the next file.  I'm missing your logic here.  Or,
maybe I didn't explain the @dirlist arrays wlell nough.
 
JE


  _____  

From: filepro-list-bounces+john=valar.com at lists.celestial.com
[mailto:filepro-list-bounces+john=valar.com at lists.celestial.com] On Behalf
Of Tyler
Sent: Friday, September 11, 2009 10:46 AM
To: filepro-list at lists.celestial.com
Subject: Re: Re: USER command questions (Fairlight)




Date: Thu, 10 Sep 2009 21:34:45 -0400
From: Fairlight <fairlite at fairlite.com>
Subject: Re: USER command questions

> Can anyone tell me how to use cp or mv with the USER command?  Or is it
just
> garbage and I should go back to SYSTEM? 


 

You're assigning the 'move' "alias" (ie., USER handle or whatever the
proper fP parlance for it is) first, there.  And then you're essentially
piping in arguments to it, rather than having them all as one command.

In shell terms, what you're doing is essentially the same as:

$ mv <<END
> -f
> /some/path
END

That's why 'mv' is bailing on you.  It's not meant to be used that way.

Forget using USER for 'mv'.  It's nothing you get interactive feedback
from, so USER is overkill.  Assemble the entire command with arguments and
feed it to SYSTEM for each file.

Also, be VERY careful with dirlist.  It has a filename length limitation
that will bite you if the filenames are longer than the memory allocated to
the function's memory storage.

Back to the original:  Only use USER when you require interactive feedback
from and/or interactive data supply to a process.  Neither 'mv' nor 'cp'
fall into that category.



 
Thanks Mark!  That was exactly the answer I was looking for!  I will stick
with SYSTEM for mv then, and OPENDIR/NEXTDIR for getting the filenames :)
(thanks to John Esak for the demo on how OPENDIR's usage)

Tyler



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20090911/dfc842e6/attachment-0001.html 


More information about the Filepro-list mailing list