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 6 2567
In 'comp.lang.c', "Andrew Edwards" <ed*******@spam freeusa.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**********@no os.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/
"Andrew Edwards" <ed*******@spam freeusa.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
On Sat, 12 Jul 2003 19:19:13 GMT, "Andrew Edwards" <ed*******@spam freeusa.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
"Emmanuel Delahaye" <em**********@n oos.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
"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
"Andrew Edwards" <ed*******@spam freeusa.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() . This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 so that when you click on it, it
will extract the files and run setup.exe which among the other will copy
these files into respective folders (the absolute paths could be written in
some config file). Of course the files should be extracted first...
|
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 accessing the
abobe mentioned asp page. It WORKS for every type of file when I
change the content type according to the file type, but it won't work
with self extracting files. When an end user downloads a self
extracting file by accessing the...
|
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 however it looks like these work on zip files only, not exe.
Does anyone know how to get around this? I would like to do it all without
having any user input. Using process.start() works however this asks the
user where to extract the files...
|
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 extracting exe starts.
But...the self extracting exe when downloaded on my mahcine, creates a wierd
named folder in c:\.
how would this folder getting cretaed? Can i make to create this folder in
temp files.
|
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 ( update.zip ),
and can automate the FTP'ing of the SE zip file to the update site.
I have, as yet, been unable to find a way of automating the creation of
a SE zip file from the initial update.zip. I have performed a rather
| |
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 (such as password and
extract path) when opening a WinZip self-extracting file on a machine
that does not have WinZip installed?
I've seen in other threads where the Shell command is used to call the
|
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 location
with the same arguments (using the Process class), a command prompt
opens, and it begins extracting files. After about 70 files have been
extracted, the main form for my application loses focus and I get an
hourglass cursor (which is normal,...
|
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 some one experience with other libaries to
|
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 exe).
On clicking the "MySetup.exe" the files should get extracted to a folder. After extracting the files, it should register the "b.dll" and start "a.exe".
requesting your help on this....
Lucky
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |