472,988 Members | 3,292 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

self extracting zip files

I have program that downloads a file from the internet and extracts it using
calls to system(). All files are extracted into the directory where my
program is located. How do I redirect the extracted files to a specified
directory?

I can use the following:

system("move *.* c:\directory");

However, this will move my program. I end up having to call system for every
file in the directory since most of them are .exe.

Your assistance is greatly appreciated.
Andrew
Nov 13 '05 #1
6 2530
In 'comp.lang.c', "Andrew Edwards" <ed*******@spamfreeusa.com> wrote:
I have program that downloads a file from the internet and extracts it
using calls to system(). All files are extracted into the directory
where my program is located. How do I redirect the extracted files to a
specified directory?

I can use the following:

system("move *.* c:\directory");

However, this will move my program. I end up having to call system for
every file in the directory since most of them are .exe.


By-definition, the contain of the string passed to system() is strongly
system-dependent. Better to ask on a newsgroup dedicated to your platform.

--
-ed- em**********@noos.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
<blank line>
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 13 '05 #2
"Andrew Edwards" <ed*******@spamfreeusa.com> wrote:
I have program that downloads a file from the internet and extracts it
using calls to system(). All files are extracted into the directory
where my program is located. How do I redirect the extracted files to
a specified directory?

I can use the following:

system("move *.* c:\directory");
Well... system(...) is standardized, but the OS commands that you can pass
to it are system specific.

BTW if you want to redefine the target directory into which a zip SFX is
unzipped to then you could try unzipping it with an unzip utility instead
of running it. Or maybe some kinds of the self extracting ZIPs could have a
command line switch to redefine the target directory. End of off topic
stuff :)
However, this will move my program. I end up having to call system for
every file in the directory since most of them are .exe.

Your assistance is greatly appreciated.
Andrew


Nov 13 '05 #3
ak
On Sat, 12 Jul 2003 19:19:13 GMT, "Andrew Edwards" <ed*******@spamfreeusa.com>
wrote:

|I have program that downloads a file from the internet and extracts it using
|calls to system(). All files are extracted into the directory where my
|program is located. How do I redirect the extracted files to a specified
|directory?
|
|I can use the following:
|
| system("move *.* c:\directory");
|
|However, this will move my program. I end up having to call system for every
|file in the directory since most of them are .exe.
|
|Your assistance is greatly appreciated.
|Andrew
|

maybe you could use the lib "Info-Zip" and build in the extract
function into your program, that would give you more control.

http://www.info-zip.org/pub/infozip/

hth
ak


--
g a n d a l f @ p c . n u
Nov 13 '05 #4
"Emmanuel Delahaye" <em**********@noos.fr> wrote:
By-definition, the contain of the string passed to system() is strongly
system-dependent. Better to ask on a newsgroup dedicated to your platform.


I would much rather eliminate the use of system(); However, since I'm new to
programming and did not want to ask you to do the work for me, I decided to
use the best thing I could find. Maybe you could give me a few pointers on
how to do this in standard C.

Thanks,
Andrew
Nov 13 '05 #5
"ak" <ak @ workmail.com> wrote...
maybe you could use the lib "Info-Zip" and build in the extract
function into your program, that would give you more control.

http://www.info-zip.org/pub/infozip/


Thanks, I'll look into it immediately.

Andrew
Nov 13 '05 #6

"Andrew Edwards" <ed*******@spamfreeusa.com> wrote in message

I would much rather eliminate the use of system();
system() is cluntzy. You will hardly ever find it in real code (at least in
a games programming environment).
Maybe you could give me a few pointers on how to do this in standard C.

C has no directory functions in the standard library. This was probably a
bad decison, but was presumably done since some platforms don't have
anything that could be described as a hierarchical filing system.

It is unusual for a non-trivial C program to rely entirely on the standard
library. You don't need to worry too much about using a platform-specific
extension to handle your directory operations. If portability is a concern,
you can isolate the platform-specific code in its own files. Then you
provide an interface to the rest of the program.

eg

char **listdir(char *path)

is your function to list all files in a directory (you will have to make a
decison on sub-directories and special files like UNIX ..).

Then for each platform you write code to list the directory. Under Windows
you use repeated calls to FindNextFile() after setting up FindFirstFile().
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nazgul | last post by:
Hi! I want to implement a small tool in Python for distributing "patches" and I need Your advice. This application should be able to package all files chosen by a user into a self-extracting.exe...
2
by: Avi | last post by:
hi, Can anyone tell me what the problem is and how to solve it The following piece of code resides on an asp page on the server and is used to download files from the server to the machine...
3
by: wenz | last post by:
Hi I have an exe which is actually a self-extracting zip file that i would like to run to extract all the files. I have the code showing how to use the j# classes and library to extract zip files...
0
by: k_nil | last post by:
I have a link on my web page for a self extracting executable file placed on the server. When the link is clicked, 1) i could see dialog box with open or save options 2) when open clicked, self...
15
by: Karl | last post by:
Hi all, I regularly use FTP to place Self Extracting Zip files on the web for remote users to update their datafiles. Works very nicely. I have automated the creation of the initial zip file (...
2
by: Robert McEuen | last post by:
Sorry if this double-posts...Google doesn't do a very good job of communicating whether something has posted or not. Using Access 97, WindowsXP Is there a way to pass command line parameters...
2
by: bjm | last post by:
I created a self extracting zip file with about 9000 files in it. I extracted it manually from the command line without a problem. However, when I tried to do the same extraction at the same...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
1
by: luckyshahoo | last post by:
I have to create a C# windows application that will take 4 different kind of files (a.exe, b.dll, c.doc etc....) and the application should generate a .exe say "MySetup.exe" file (self extracting...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.