Issue related to system() call and file handles.



Okay, this one's a tough one for me to explain so this might take a few
e-mails to get the idea across. Here's what I got though.

I have this application running on a Sun/Solaris machine, written in
C, using the Sun Forte Developer 7 C 5.4 Compiler released a few years
ago. Not exactly old but, you get the picture.

Now, most if not all the file handles on this machine are most likely
being used up by a secondary process and/or application. I can't help
it, they are just gone. So for file manipuation I've been using open,
write, etc. The older file handle functions. No big deal, it works
fine.

But, I have a system() call, that doesn't exactly fail, it just
doesn't exactly 'work' properly. Here's the issue.

The command makes a call to an Oracle command called 'exp'. It's an
exporting application. Helps dump the database into a raw file. For
input, I have this script I make on the fly that calls this application
and feeds it commands to run properly and dump the desired contents.
One problem though, it seems like, the exp command, can't create the
appropreate file (Although it does make the file, it ends up a 0 length
file) and does nothing productive.

If I run the same script that my application generated though, thru a
second shell, the script works just fine. Even when the main
application that I've created is still running in the background.

So, why is it, when I call this script using system("./myScript"); it
fails, but when I manually run ./myScript it runs fine?

Any ideas?

Tony

.



Relevant Pages

  • Re: Command to dump/restore user info OSR5
    ... Write a script that does a dump and then compares the current dump against the previous such dump. ... You don't have a diff unless you install the devsys or gnutools. ... The order of the filenames on the diff command line, and the way the script renumbers filenames, means that the first instance is the old password and the next instance is the new password. ...
    (comp.unix.sco.misc)
  • Re: Need some small help on shell script - delete old files
    ... command so that it does not search subdirectories past this directory ... The find command shows all files in the directory and subdirectories. ... I am using your script. ... recent dump is always left un-compressed with no .gz extension. ...
    (comp.unix.shell)
  • Re: Need some small help on shell script - delete old files
    ... I am using your script. ... recent dump is always left un-compressed with no .gz extension. ... or use the "wait" command to see if it must delay the start of the ... The second dump has to be coming from an alternate CRON job or an AT ...
    (comp.unix.shell)
  • Re: Issue related to system() call and file handles.
    ... The command makes a call to an Oracle command called 'exp'. ... Helps dump the database into a raw file. ... I have this script I make on the fly that calls this application ... second shell, ...
    (comp.lang.c)
  • Re: Problems trying to configure Linux laptop to print to Windows XP shared printer
    ... map to guest = Never ... check password script = ... enumports command = ... ldap delete dn = No ...
    (comp.os.linux.setup)