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).










share|improve this question


























    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).










    share|improve this question
























      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).










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 26 '11 at 23:45









      Dmitri

      6,90632638




      6,90632638
























          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.






          share|improve this answer























          • 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


















          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.






          share|improve this answer




























            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}" />





            share|improve this answer










            New contributor




            Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.














            • 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











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            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

























            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.






            share|improve this answer























            • 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















            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.






            share|improve this answer























            • 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













            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.






            share|improve this answer














            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.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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


















            • 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












            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.






            share|improve this answer

























              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.






              share|improve this answer























                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.






                share|improve this answer












                Looking at the 'Get Task' documentation, I see the 'dest' field is required so I think you're out of luck.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 27 '11 at 4:17









                hoipolloi

                6,54412128




                6,54412128






















                    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}" />





                    share|improve this answer










                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.














                    • 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















                    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}" />





                    share|improve this answer










                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.














                    • 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













                    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}" />





                    share|improve this answer










                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    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}" />






                    share|improve this answer










                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    share|improve this answer



                    share|improve this answer








                    edited Nov 21 at 12:26





















                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    answered Nov 20 at 16:22









                    Madhu Arukala

                    11




                    11




                    New contributor




                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





                    New contributor





                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    Madhu Arukala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.








                    • 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




                      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


















                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks