<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT color=#0000ff 
size=2 face=Arial>You are using the wrong filePro tool 
entirely.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 face=Arial>I 
believe this could be written in about 5 lines of code if you were to do it with 
the right processing.&nbsp; The user command is not in any stretch the right 
function to use to do what you want to accomplish.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>You sound frustrated at filePro for not being able to do something 
simple.&nbsp; You haven't taken the time to find out how this should be 
done.&nbsp; I suppose it is admirable that you at least tried something you 
thought might work.&nbsp; However, when it didn't work, your bashing about on 
filePro is disheartening.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>When you want to open a directory (folder) and do something to each 
of the files you find therein, use the "opendir() function.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>It has some special masks to show you only the specified filePro 
format types of screens outputs, etc.&nbsp; But, its real value is just 
specifying some wildcard to retrieve only the exact files you want.&nbsp; You 
could specify "*" and get every file in a directory (in which case you will also 
get the . and .. entrires, so you have to be aware of this and skip over them 
with a test.&nbsp; But essentially, to use opendir() you do it like 
this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;then: declare num_files(4,.0), cnt(4,.0);&nbsp; 
cnt="1"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;then: 
num_files=opendir("*","/tmp/path/to/dir")</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>After the the line&nbsp;with the opendir() is exectured, the system 
maintained arrays @dirlist, @dirlist_filename&nbsp; and @dirlist_name and 
@dirlist_ext are filled immediately with all the filenames (and 
dirnames)&nbsp;found in that wildcard search of the specified folder. In this 
case "*"&nbsp; (it could be "*.txt" or "*.csv" and so on, then you would only 
get that wildcarded group of files thrown into the @dirlist arrays.)&nbsp; It is 
important to note that the opendir() command works like all the other file I?O 
commands in that it returns a value to the variable on the left side of the 
operation.&nbsp; So, not only are these arrays filled with the file and 
directory names found by the wild card filter, but the total number of them is 
stored into the variable you put in the opendir() command. In my example 
num_files. (Check the manual for what @dirlist_filename/name/ext each actually 
hold. It is clearly laid out there.)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>This is extremely useful because you can start a counter like I'm 
showing above, and point to each file found in the directory until you reach the 
total number of files found by the search... then you end the operation and move 
on.&nbsp; In other words when cnt goes one higher than num_files, you are 
done.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>So, you will be saying something like the following.&nbsp; It will be 
somewhat stylized, I haven't looked closely at your code, and don't have time to 
code exadctly what you need... but you can modify the code I"ll write now in 
about 3 minutes to do just what you need done.&nbsp; Here I go, I'm timing 
myself....</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&lt;GET_TIME&gt;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: declare 
num_files(4,.0),&nbsp;num_files(4,.0);&nbsp; cnt="1"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: 
num_files=opendir("*","/some/path/to/a/folder")</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>loop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if: cnt gt 
num_files</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: 
num_files=closedir();&nbsp; return (or go somewher else)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if: @dirlist_filename[..] eq "." or @dirlist_filename [cnt] eq 
".."</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: cnt=cnt + "1";&nbsp; goto 
loop</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if: 
@dirlist_filename[cnt]&nbsp;eq "something you want" to move"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: declare SysCmd;&nbsp; 
SysCmd="mv" &lt; @dirlist_filename[cnt]&nbsp;&nbsp;the_other_place_and_name { 
""</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: system 
SysCmd</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then: cnt=cnt + "1";&nbsp; goto 
loop</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&lt;/GET_TIME&gt;&nbsp; Just about 1 minute 30 
seconds.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>So, you see, it is not so difficult to do a simple job in filePro if 
you use the right tool.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>Good luck,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>John Esak</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>P.S.&nbsp; Tyler, please note the num_files=closedir()&nbsp; it is 
very important to close the opening of the directory when you're done.&nbsp; You 
may want to open another folder and you would not be able to do it unless you 
execute the closedir().&nbsp; Do it without arguments and into any variable... 
why not the one that was used to hold the total number of found 
files.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=578314501-11092009><FONT size=2 
face=Arial>&nbsp;&nbsp; </FONT></SPAN></DIV><BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
  <HR tabIndex=-1>
  <FONT size=2 face=Tahoma><B>From:</B> 
  filepro-list-bounces+john=valar.com@lists.celestial.com 
  [mailto:filepro-list-bounces+john=valar.com@lists.celestial.com] <B>On Behalf 
  Of </B>Tyler<BR><B>Sent:</B> Thursday, September 10, 2009 8:33 
  PM<BR><B>To:</B> filepro-list@lists.celestial.com<BR><B>Subject:</B> USER 
  command questions<BR></FONT><BR></DIV>
  <DIV></DIV>Has anyone managed to get his to work on SCO Openserver with the mv 
  or cp commands?&nbsp; I can get ls to work, but no matter what I try I get the 
  command usage output to std err.&nbsp; These are such basic commands I can't 
  believe they wouldn't work for USER as it is described in the 
  manual.<BR><BR>All I really want is to list the csv files in a directory, 
  process them, then move them to another directory.&nbsp; This extremely basic 
  file manipulation to be ridiculous difficult to do in filePro! <BR><BR>Here is 
  what I have:<BR><BR>::DECLARE filepath(128,*); 
  filepath="/public/mailerListsSent/Prospects/":<BR>::DECLARE 
  filename(32,*):<BR>::debug on:<BR>::USER dirlist = ls:<BR>::USER move = 
  mv:<BR>::dirlist=filepath{"/*.csv"; filename=dirlist:<BR>loop01s:filename eq 
  "":goto loop01e:<BR>::show filename:<BR>::'msgbox 
  filepath{filename&lt;filepath{"imported/"{filename:<BR>::'goto 
  loop01n:<BR>::move = "-f":<BR>::move = filepath{filename:<BR>::move = 
  filepath{"imported/"{filename:<BR>::i=move:<BR>::end:<BR>loop01n::filename=dirlist; 
  goto loop01s:<BR>loop01e:::<BR><BR>Can anyone tell me how to use cp or mv with 
  the USER command?&nbsp; Or is it just garbage and I should go back to 
  SYSTEM?<BR></BLOCKQUOTE></BODY></HTML>