The reason that you did not get RC 7 (Invalid Request String) was because
of a feature of the STAF Command Parser which tries to "help" you in case
you forgot to specify double quotes around a value that contains spaces.
In this case, it wasn't being helpful when it assumed that you meant you
were wanting to copy files with EXT "tmp TYPE F" so you didn't get an
error and no files were copied since none ended in ".tmp TYPE F". If you
had specified the CASEINSENSITIVE option (or any other option that doesn't
require a value after EXT tmp and before the TYPE option, then RC 7
(Invalid Request String) would have been returned as follows:
STAF local FS COPY DIRECTORY D:\staf_testing TODIRECTORY D:\temp TOMACHINE
172.52.xxx.xxx EXT tmp CASEINSENSITIVE TYPE F
Error submitting request, RC: 7
Additional info
---------------
You may have no more than 0 argument(s). You specified 1 argument(s). The
first excess argument is, TYPE F.
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
----- Forwarded by Sharon Lucas/Austin/IBM on 06/20/2013 02:16 PM -----
From: Sharon Lucas/Austin/IBM
To: 陈加萍 <chenjiap...@dce.com.cn>,
Date: 06/20/2013 08:26 AM
Subject: Re: [staf-users] [Consultation questions about STAF] COPY
DIRECTORY with NAME or EXT does not work
In the syntax you showed, you are missing the FS service (perhaps this was
just a typo) and you are specifying the TYPE option which is not a
supported option for the FS COPY DIRECTORY request. Note that TYPE is an
option for a FS LIST DIRECTORY request but not for a FS COPY DIRECTORY
request. However, it looks like the STAF User's Guide does include some
examples of a COPY DIRECTORY with a TYPE option which it shouldn't. I
will fix that in the documentation. Also, you probably should have had RC
7 (Invalid Request String) returned when specifying the TYPE option on a
COPY DIRECTORY request. I'll also look into that.
Here's the syntax for a FS COPY DIRECTORY request (note that it does not
include option TYPE):
COPY DIRECTORY <Name> [TODIRECTORY <Name>] [TOMACHINE <Machine>]
[NAME <Pattern>] [EXT <Pattern>] [CASESENSITIVE | CASEINSENSITIVE]
[TEXTEXT <Pattern>... [FORMAT <Format>]]
[RECURSE [KEEPEMPTYDIRECTORIES | ONLYDIRECTORIES]]
[IGNOREERRORS] [FAILIFEXISTS | FAILIFNEW]
So, if you specify the following request (not specifying the TYPE option
and specifying your TOMACHINE's IP address), it should work (it worked for
me). Post again if you're still having a problem..
STAF local FS COPY DIRECTORY D:\staf_testing TODIRECTORY D:\temp TOMACHINE
172.52.xxx.xxx EXT tmp CASEINSENSITIVE
Note that if all your *.tmp files are actually text files and you may want
to copy them by specifying the TEXTEXT option instead of the EXT option so
that they will not be copied just as binary data but as text which means
that the line-ending characters (if any) in the files being copied will be
converted as specified via the FORMAT option (which is NATIVE if not
specified which means to convert the line-ending characters in the file(s)
being copied to those of the target machine so that the line-ending
characters are appropriate for the target platform) and codepage
conversion will be performed. This can be useful for example if the
source machine and the target machine have different operating systems,
e.g. one is Windows and one is Linux which means that they use different
line ending characters. For example:
STAF local FS COPY DIRECTORY D:\staf_testing TODIRECTORY D:\temp TOMACHINE
172.52.xxx.xxx TEXTEXT tmp CASEINSENSITIVE
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: 陈加萍 <chenjiap...@dce.com.cn>
To: <staf-users@lists.sourceforge.net>,
Date: 06/20/2013 07:36 AM
Subject: [staf-users] [Consultation questions about STAF] COPY
DIRECTORY with NAME or EXT does not work
HI,
First, I'm very sorry to disturb you.
I am writing to consult the problem that the STAF about COPY DIRECTORY
with NAME or EXT does not work. According to the user guide inside the
following examples:
Goal: Copy all files with an extension of "tmp" in directory c:/testcase
to directory c:/testcase on machine Client1. Match the extension in a case
insensitive manner. Do not recurse down subdirectories.
Syntax: COPY DIRECTORY c:/testcase TOMACHINE Client1 EXT tmp TYPE F
CASEINSENSITIVE
My Syntax is: staf local copy directory D:\staf_testing
todirectory D:\temp\ tomachine 172.52.xxx.xxx EXT tmp TYPE F
caseinsensitive
My files in D:\staf_testing is: myfile.tmp,staf_file.tmp and so
on.
I want to copy all *.tmp files to D:\temp\, but failed. Can you tell
me why?
Thank you very much and Best wishes !
----------------------------------------------------
chenjiaping
Email:chenjiap...@dec.com.cn
----------------------------------------------------
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users