To access just the result part, you can do: <log message="1">STAFResult['result']</log>
An alternative to submitting a remote STAX EXECUTE request, you could just
use a <process> in your local STAX job, to run an "ls" (on Unix) or
"dir" (on Windows) on the remote system to get the directory content. You
could also use <process> to run a "cp" (on Unix) or "copy" (on Windows),
but of course those commands could not copy the files to remote machines.
I still don't understand why you don't want to use a <stafcmd> to submit
the remote FS LIST/COPY requests. Using the FS service provides a common
command to do the list/copy regardless of the operating system, which means
you will have simpler code (especially since you won't have to parse the
output from the OS command, since the directory listing from the FS LIST
request will be marshalled data).
Regarding having 2 lists (one for files and one for directories), note that
if you use a FS COPY DIRECTORY request with the RECURSE option, it will
copy all of the files and directories (including subdirectories).
Can you elaborate on why you don't want to use a <stafcmd> to submit the
remote FS requests?
Thanks,
David
David Bender 11501 Burnet Rd. Phone (T/L): 1-512-286-5315
STAF/STAX Development Bldg. 903-5B002 (363-5315)
Austin, TX ITN: 23635315
IBM Software Group, 78758-3400 Email: [email protected]
WPLC
From: Sunny A <[email protected]>
To: [email protected]
Date: 06/01/2010 01:44 PM
Subject: [staf-users] Query regarding directory/file('s) display and
transfer
My files are:
Test.xml(On remote machine)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function = "Main"/>
<function name = "Main">
<function-list-args>
<function-arg-def name="path" type="required"/>
</function-list-args>
<sequence>
<script>
import os
dirlist = os.listdir(path)
</script>
<return>dirlist</return>
</sequence>
</function>
</stax>
Mian.xml(on local machine):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function = "Main"/>
<script>
remoteJob = 'C:/tests/listDir.xml'
remoteMachine = 'staf3a'
remotePath = '\'C:/tests\''
</script>
<function name = "Main">
<sequence>
<stafcmd>
<location>remoteMachine</location>
<service>'STAX'</service>
<request>'EXECUTE FILE %s MACHINE %s ARGS %s WAIT RETURNRESULT' %
(remoteJob, remoteMachine, remotePath) </request>
</stafcmd>
<log message="1">STAFMarshalling.formatObject(STAFResult)</log>
</sequence>
</function>
</stax>
Then when you submit the local job, the log would have the following (i.e.
the dir listing from the remote machine in the "result"):
20100525-15:40:38 {
result : ['cvsbackup.xml', 'listDir.xml', 'Scenario1.xml',
'stress.xml']
endTimestamp : 20100525-15:39:17
status : Normal
staf-map-class-name: STAF/Service/STAX/JobResult
testcaseTotals : {}
startTimestamp : 20100525-15:39:17
jobID : 21
}
Hi All,
Can u please answer my query.
>From the above mentioned o/p by running the script , i only need the result
part.
Also i need to have two lists,one for files and other for directories so
that when i am transferring,
These two lists will be returned so that the files present in the fileList
are transferred using FS copy file and directories in the dirList can be
transferred using FS Copy Dir.
Is there anyway to do this.
Also is there any way to do it without using STAX/FS service.
Do let me know your inputs.
Thanks,
Sunny
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
------------------------------------------------------------------------------
_______________________________________________ staf-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/staf-users
