Re: SHELLing

From: Craig D. Best (cbest_at_info.census.gov)
Date: 05/20/04


Date: Thu, 20 May 2004 10:42:50 -0500

Thanks, Wobby!

It's a weird solution I used but it seems to work right now. I now call a
batch file which first copies a file to the c:\temp directory and my VB
program waits until the bat file deletes it before preceeding. It's strange
code but it works! I actually have 2 loops back to back.......I shell out
to my batch file, loop until the file exists in c:\temp and then loop until
the file doesn't exist in c:\temp and then continue.

UncleWobbly wrote:

> http://www.vbcode.com/asp/showsn.asp?theID=9026
>
> "Craig D. Best" <cbest@info.census.gov> wrote in message
> news:40AA7DAD.FAA004B0@info.census.gov...
> > I'm writing a backup utility in VB6 where I collect some info from the
> > user using a form and then SHELL out to run a compression program
> > (WZZIP.EXE) to perform the backup based upon the user input. After
> > performing the zip which takes up to 5 minutes, I want to verify the
> > existence of the zip file and report to the user a backup failure if the
> > zip file doesn't exist.
> >
> > The problem I have is that when the program shells, while it's doing
> > it's DOS work, the VB6 program continues to run. Since it doesn't
> > find the file when it checks (it's not created yet), I get an error
> > message that the backup failed. I vaguely recall back in the old
> > BASICA days that execute would halt during child processes.....that's
> > what I need here.
> >
> > Is there a convenient way to pause execution of the program until the
> > SHELL completes processing? I thought about writing a function to
> > open the zip file assuming I couldn't open it while it was locked by the
> > WZZIP. ie Loop until I'm able to open it and then exit the loop but
> > that seems a bit sloppy and unstable.
> >
> > I'd appreciate any feedback or ideas on this problem?
> >
> >
> > --
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Craig Best
> > Supervisory Geographer
> > US Census Bureau
> > Kansas City Regional Office
> > 1211 N 8th St
> > Kansas City, KS 66101
> > (voice) 913-551-6833
> > (fax) 913-551-6780
> > cbest@info.census.gov
> > http://www.census.gov
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Craig Best
Supervisory Geographer
US Census Bureau
Kansas City Regional Office
1211 N 8th St
Kansas City, KS  66101
(voice) 913-551-6833
(fax) 913-551-6780
cbest@info.census.gov
http://www.census.gov
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Relevant Pages

  • Re: redirection
    ... Use the SHELL command. ... LOOP ... to write a batch file from the original text file and SHELL to that. ...
    (comp.lang.basic.misc)
  • Re: Unix-ify File Names
    ... special characters do make it more difficult to handle arbitrary file ... At least in POSIX shell. ... it's old value inside of the loop. ...
    (Debian-User)
  • Re: PHP [win32] & CLI Testers needed.
    ... written, lets just say to create shell emulation for now, and have ... My previous attempts to create the source below, ended with the loop ... finally resolve any issues due to this problem in PHP compatibility. ... Debug Warning: testforLinuxUser.php line 24 - stream_select: supplied argument is not a valid stream resource ...
    (php.general)
  • PHP [win32] & CLI Testers needed.
    ... written, lets just say to create shell emulation for now, and have ... My previous attempts to create the source below, ended with the loop ... stopping due to undefined varible, that requested for user input, the ... finally resolve any issues due to this problem in PHP compatibility. ...
    (php.general)
  • [Test Needed] PHP [win32] & CLI required for testing.
    ... written, lets just say to create shell emulation for now, and have ... My previous attempts to create the source below, ended with the loop ... stopping due to undefined varible, that requested for user input, the ... finally resolve any issues due to this problem in PHP compatibility. ...
    (alt.php)