Sign in to follow this  

The internet, winsock, and C++.

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I have a question. I'm trying to make a function that searches the web (well, certain websites) for a certain name inside an archive, if it finds the name, it downloads the file to the temp directory, and if it finds the name of file with the .wad extension, it extracts it to a certain directory. Now, I was wondering how i'd go about this? I'm thinking I'd have to use winsock to connect to a site, where the client is the user, and the server is the site, but then, I wouldn't know how to search it. So, I was wondering how i'd search the site they just connected to for this name anywhere inside a .zip or .rar's name, it downloads it, searches it, if it finds, it sends it to a specified directory, else, it discards it. Any help would be appreciated, thank you for your time, --Lenox

Share this post


Link to post
Share on other sites
You can't examine an archive's contents without first downloading the archive itself. Your best bet in any case is to write a shell script building on standard tools like wget.

Share this post


Link to post
Share on other sites
Well, if only I knew a way to write a shell script. Anyways, even after I wrote a shell script, how would I go about then searching that archive? Would I just use the shell script to search it, as well? Any help is appreciated, thank you (I'm going to go find out now how to extract the contents of a .zip or .rar, just in case.)

Share this post


Link to post
Share on other sites
The shell script should basically look like this:

Run a program like wget to download the file.
Run the decompression program with appropriate arguments to make it list the archive contents.
For each filename output above:
If it matches the one you're looking for:
Set a flag.
If the flag is set:
Run the decompression program with appropriate arguments to extract
the desired file in the appropriate location.

Share this post


Link to post
Share on other sites

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this