Hi , Sorry for cluttering your mailbox. My main requirement is that suppose we have a main directory MAIN and it contains 200 subdirectories and some files.
Now we want to get the list of 200 directories in one list and the files in second list (Right now we are not considering the files in the sub-directories.) We don't want to use FS service because it will give a separate list of everything and when we do FS COPY DIRECTORY,it will copy all files serially by directory after directory which consumes time. Bcoz of the following drawback,we want separate list for files and directories so that we can just parallel iterate and use FS COPY FILE and FS COPY DIRECTORY. Hope u got me :) Let me know your inputs if any. Thanks and Regards, Sunny Arora From: David Bender <bda...@us.ibm.com> To: Sunny A <sunn...@tcs.com> Cc: staf-users@lists.sourceforge.net Date: 06/02/2010 03:48 AM Subject: Re: [staf-users] Query regarding directory/file('s) display and transfer 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 STAF/STAX Development IBM Software Group, WPLC 11501 Burnet Rd. Bldg. 903-5B002 Austin, TX 78758-3400 Phone (T/L): 1-512-286-5315 (363-5315) ITN: 23635315 Email: bda...@us.ibm.com Sunny A ---06/01/2010 01:44:02 PM---My files are: Test.xml(On remote machine) From: Sunny A <sunn...@tcs.com> To: staf-users@lists.sourceforge.net 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 staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------------ _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users =====-----=====-----===== 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
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
<<image/gif>>
------------------------------------------------------------------------------
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users