Ant: echo file contents to console with Get task?
up vote
3
down vote
favorite
Just what the title says - is it possible to echo the response contents without having to store the file?
I would also settle for being able to throw out the results, so a dest
file is not created (on Windows, so no /dev/null
).
java ant
add a comment |
up vote
3
down vote
favorite
Just what the title says - is it possible to echo the response contents without having to store the file?
I would also settle for being able to throw out the results, so a dest
file is not created (on Windows, so no /dev/null
).
java ant
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Just what the title says - is it possible to echo the response contents without having to store the file?
I would also settle for being able to throw out the results, so a dest
file is not created (on Windows, so no /dev/null
).
java ant
Just what the title says - is it possible to echo the response contents without having to store the file?
I would also settle for being able to throw out the results, so a dest
file is not created (on Windows, so no /dev/null
).
java ant
java ant
asked Jul 26 '11 at 23:45
Dmitri
6,90632638
6,90632638
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
4
down vote
accepted
On windows there are special file called NUL
which has the same function as /dev/null on *nix
(there are also CON, PRN, etc, see http://en.wikipedia.org/wiki/Device_file)
I think it is possible to use this file as the dest param
<get src="http://blahblahblah..." dest="NUL" />
If you want to echo the result to the console, you can use CON as the destination
<get src="http://blahblahblah..." dest="CON" />
I dont know if it is a proper solution in the ant task, but somehow just work.
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
add a comment |
up vote
0
down vote
Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.
add a comment |
up vote
-1
down vote
Specify the file path in srcfile. the content of the file will be stored into variable from the given file
<loadfile property="content" srcfile="filepath"/>
<echo message="========================================================"></echo>
<echo message="${content}" />
New contributor
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
On windows there are special file called NUL
which has the same function as /dev/null on *nix
(there are also CON, PRN, etc, see http://en.wikipedia.org/wiki/Device_file)
I think it is possible to use this file as the dest param
<get src="http://blahblahblah..." dest="NUL" />
If you want to echo the result to the console, you can use CON as the destination
<get src="http://blahblahblah..." dest="CON" />
I dont know if it is a proper solution in the ant task, but somehow just work.
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
add a comment |
up vote
4
down vote
accepted
On windows there are special file called NUL
which has the same function as /dev/null on *nix
(there are also CON, PRN, etc, see http://en.wikipedia.org/wiki/Device_file)
I think it is possible to use this file as the dest param
<get src="http://blahblahblah..." dest="NUL" />
If you want to echo the result to the console, you can use CON as the destination
<get src="http://blahblahblah..." dest="CON" />
I dont know if it is a proper solution in the ant task, but somehow just work.
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
On windows there are special file called NUL
which has the same function as /dev/null on *nix
(there are also CON, PRN, etc, see http://en.wikipedia.org/wiki/Device_file)
I think it is possible to use this file as the dest param
<get src="http://blahblahblah..." dest="NUL" />
If you want to echo the result to the console, you can use CON as the destination
<get src="http://blahblahblah..." dest="CON" />
I dont know if it is a proper solution in the ant task, but somehow just work.
On windows there are special file called NUL
which has the same function as /dev/null on *nix
(there are also CON, PRN, etc, see http://en.wikipedia.org/wiki/Device_file)
I think it is possible to use this file as the dest param
<get src="http://blahblahblah..." dest="NUL" />
If you want to echo the result to the console, you can use CON as the destination
<get src="http://blahblahblah..." dest="CON" />
I dont know if it is a proper solution in the ant task, but somehow just work.
edited Jul 27 '11 at 4:43
answered Jul 27 '11 at 4:36
hanung
33338
33338
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
add a comment |
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
Thanks, never knew about those. NUL works as expected, CON unfortunately gives a '(Access is denied)', but like I said, NUL will do. Hmm, would be nice to have a system independent abstraction over /dev/null & NUL.
– Dmitri
Jul 27 '11 at 6:10
add a comment |
up vote
0
down vote
Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.
add a comment |
up vote
0
down vote
Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.
add a comment |
up vote
0
down vote
up vote
0
down vote
Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.
Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.
answered Jul 27 '11 at 4:17
hoipolloi
6,54412128
6,54412128
add a comment |
add a comment |
up vote
-1
down vote
Specify the file path in srcfile. the content of the file will be stored into variable from the given file
<loadfile property="content" srcfile="filepath"/>
<echo message="========================================================"></echo>
<echo message="${content}" />
New contributor
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
add a comment |
up vote
-1
down vote
Specify the file path in srcfile. the content of the file will be stored into variable from the given file
<loadfile property="content" srcfile="filepath"/>
<echo message="========================================================"></echo>
<echo message="${content}" />
New contributor
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
add a comment |
up vote
-1
down vote
up vote
-1
down vote
Specify the file path in srcfile. the content of the file will be stored into variable from the given file
<loadfile property="content" srcfile="filepath"/>
<echo message="========================================================"></echo>
<echo message="${content}" />
New contributor
Specify the file path in srcfile. the content of the file will be stored into variable from the given file
<loadfile property="content" srcfile="filepath"/>
<echo message="========================================================"></echo>
<echo message="${content}" />
New contributor
edited Nov 21 at 12:26
New contributor
answered Nov 20 at 16:22
Madhu Arukala
11
11
New contributor
New contributor
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
add a comment |
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
7
7
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
Please refrain from answering in code only. Explain in text and/or comments what you are doing, so that future readers may benefit as well.
– Adriaan
Nov 20 at 16:25
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f6837946%2fant-echo-file-contents-to-console-with-get-task%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown