Windows native and system copy

GCC Consulting gcc at optonline.net
Mon Mar 21 16:41:46 PST 2005


I had created a process that copies a file from one computer to a server and
renames the file using the system command. 
	copy upstrack.csv f:\temp\ups032105.txt

 When processing returns to the processing table, the variable holding the first
command is cleared and replaced with the file name.  

The next step is to import the values from the file and post them to an order
header file.

The program works fine when called from a batch file from the command line.

However, when run from the task manager the first part of the program worked,
the copy/rename.  However, the import function failed.

After talking with Nancy Palmquist, she confirmed what I had suspected.  I had
placed a sleep 5000 prior to the import.  This let the program take a break for
5 seconds before the import ran.  With this in place, the program ran perfectly.

Nancy has had some conversation with ken about this problem and he has said that
sleep isn't necessary.  However, Nancy and I feel that, at least in a
network/Windows environment, processing returns to the processing table before
the new file has had a chance to close.  It will exist, but won't be closed and
available for import or whatever.

By delaying processing those few seconds, it clears the problem.  

In this case, a 5 second delay doesn't create a problem as this is run after
hours.  A little further testing  would let me find the minimum time necessary.
Nancy had mentioned a time substantially shorter than I am using.  Sleep 600.

So, if you are doing or going to do some think similar, keep this in mind if
your processing doesn't seem to be working.

Richard Kreiss
GCC Consulting 




More information about the Filepro-list mailing list