Hi Micah, I want the same piece of code to work on vmware environment in addition to all the other platforms. In vmware Hypervisor environment there is no support for system(), so I will not be able to use the same. Well I am not keen on processing the output till wget finishes the download. In my application I can process the file only after the entire file download is complete. Using apis of wget I will be forcing a hard dependency on wget for file downloading. I need to do it programmatically only if wget is available on the system I am trying to do the download.
Can you please suggest any pointers on writing the interface, I have never done it anytime. If you can suggest some pointers on the same, it will be great. All I need to do is to download a file using http from another remote machine. That is all. You have mentioned that there is no portable way to use functions of wget. Is there any platform specific way to do that. If you can suggest ways to do on one platform also it will be great. If you can suggest a way of doing it on Linux, it will help. Thanks for your time and help. Thanks and Regards, Aruna On Thu, Jun 24, 2010 at 12:13 AM, Micah Cowan <[email protected]> wrote: > On 06/23/2010 03:14 AM, Chitra Nanda wrote: > > Hi, > > > > I want to know if I can call wget programmatically from c/c++ program. I > > don't want to use system(wget). That will > > cause portability issues for me. I would need that to work on all > platforms. > > system() is portable to all platforms: it is a part of the C and C++ > standards, and is in fact the only portable way to do as you request. > However, it doesn't provide you with the output that came from wget > (directly; you could redirect to a file and parse that), and blocks > until wget is finished. This may make it less desirable for you to use, > in which case you'll most likely have to write an interface yourself > that does what you want, and implement it using platform-specific code > on whichever platforms you wish to support. > > > Since it is not part of any lib*.so I cannot load it dynamically at run > time > > either. > > > > Is there any way in which I can use functions/APIs of wget and call them > > directly from C/C++ code. Will that work. Can you please suggest. > > There's no portable way to do that. > > > -- > Micah J. Cowan > http://micah.cowan.name/ >
