forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Piping standard output

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Tue Nov 04, 2008 5:54 pm    Post subject: Piping standard output Reply with quote

Hi

Can anyone tell me why this does not work?

list create,1
run cmd /c xcopy @chr(34)c:\documents and settings\dmonckt\my documents\my pictures\*.*@chr(34) h:\atest /s,WAIT,PIPE
%p = @pipe()
list assign,1,%p


The XCOPY works fine but not the piping part?

Thanks

David.M
Back to top
View user's profile Send private message
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Tue Nov 04, 2008 8:37 pm    Post subject: Reply with quote

Hi David,

I think the xcopy command doesn't produce any "standard output", so that the value for the PIPE parameter is unrecognized.

_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Wed Nov 05, 2008 8:49 am    Post subject: Reply with quote

I thought what you see in the console screen is the standard output! If it is then there is loads of it scrolling up the screen. I might have to experiment with the XCOPY switches to see what happens.

Thanks

David.M
Back to top
View user's profile Send private message
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Wed Nov 05, 2008 1:05 pm    Post subject: Reply with quote

Hi David,

you can try this:

...
run cmd /c xcopy @chr(34)c:\documents and settings\dmonckt\my documents\my pictures\*.*@chr(34) h:\atest /s,WAIT 10,PIPE
...

_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Nov 05, 2008 5:30 pm    Post subject: Reply with quote

Hi dmonckton

Don't use WAIT with PIPE. The PIPE option will halt your script until the command is finished.

Try this:
Code:
run cmd /c xcopy @chr(34)"c:\documents and settings\dmonckt\my documents\my pictures\"*.*@chr(34)h:\atest /s,PIPE
%%Return = @pipe()
Info %%Return
exit
Back to top
View user's profile Send private message Send e-mail
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Wed Nov 05, 2008 5:42 pm    Post subject: Reply with quote

That is why I advised to add (e.g.) "10" like a parameter for the WAIT
_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Fri Nov 07, 2008 11:27 am    Post subject: Reply with quote

Ok Jerry you were right XCOPY does not produce any output if you
run it from the commandline. If you run it from the console it does!

Thanks

David...
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Nov 07, 2008 3:13 pm    Post subject: Reply with quote

Why are you using xcopy anyway? The VDS File command can copy files.
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Tue Nov 11, 2008 9:44 am    Post subject: Reply with quote

The reason for using XCOPY is.....

When I copy the source I want the original path copied aswell. VDS file copy fails if the target path does not exist already where as XCOPY creates the target path on the fly.

Thanks

David.M
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Nov 16, 2008 2:30 am    Post subject: Reply with quote

You can always have VDS create the target path before initiating the copy process.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group