* Re: system() refuses to work!!! HELP
@ 2003-10-15 6:34 Moises D. Deangelo
0 siblings, 0 replies; 9+ messages in thread
From: Moises D. Deangelo @ 2003-10-15 6:34 UTC (permalink / raw)
To: cygwin
It did not work. Will it be that I found a bug??? How much luck I have.. :-)
It follows the source. that program does not do anything of important! It is
alone a test.
what we most can do?
I changed the command for "DIR" who list the directories of the windows just
to facilitate the comprehension and so that it to do not are necessary to do
an upload of sound.exe. Try, with that program execute some other command!
Here, already tried of everything, and anything (not) worked.
*************************************************
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
main()
{
int a,b,c,d,e,f,g,h,j;
FILE *stream;
printf("Programa Gerador de Resultados para Teste:");
printf("\n\nEntre com as Faixas");
printf("\nNúmero a ser comparado: ");scanf("%d",&c);
printf("\n....................De: ");scanf("%d",&a);
printf("\n.....................A: ");scanf("%d",&b);
d = c;
f = a;
g = b;
j = 1;
while(g <= c){
e = f * g;
h = d - e;
if((stream = fopen("dtr1.txt", "at")) != NULL){
fprintf(stream,"\n %d * %d = %d -r = %d",f,g,e,h);
}
fflush(stdout);
fclose(stream);
if(j >= c){
f = a;
j = 0;
g++;
printf("\nF: %d\tG %d:",f,g);
fflush(stdout);
}
f++;
j++;
}
if((system("dir")) == 0){
printf("\n\nComando executado com sucesso");
}
else{
printf("\n\ncomando falhou");
}
}
***********************************************
Em 15 Oct 2003, cygwin@cygwin.com escreveu:
>On Wed, Oct 15, 2003 at 01:10:08AM -0300, Moises D. Deangelo wrote:
>>When entering with the command ls -l /bin/sh.exe, the appeared following:
>>
>>-rwxr-x---+ 1 Diego Usu?rios 83456 Aug 11 10:45 /bin/sh.exe
>
>Ok. The next question is if "sound.exe" is in your path. Does something
>like:
>
>system("/cygdrive/c/dir/sound.exe")
>
>work?
>
>/cygdrive/c/dir would be cygwin's way of typing c:/dir
>
>dir would be the place where sound.exe lives.
>
>--
>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>Problem reports: http://cygwin.com/problems.html
>Documentation: http://cygwin.com/docs.html
>FAQ: http://cygwin.com/faq/
>
>----------
_________________________________________________________
Voce quer um iGMail protegido contra vÃrus e spams?
Clique aqui: http://www.igmailseguro.ig.com.br
Ofertas imperdÃveis! Link: http://www.americanas.com.br/ig/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: system() refuses to work!!! HELP
2003-10-15 9:10 ` Chris January
@ 2003-10-15 15:09 ` Igor Pechtchanski
0 siblings, 0 replies; 9+ messages in thread
From: Igor Pechtchanski @ 2003-10-15 15:09 UTC (permalink / raw)
To: cygwin
On Wed, 15 Oct 2003, Chris January wrote:
> > It did not work. Will it be that I found a bug??? How much luck I
> > have.. :-)
> > It follows the source. that program does not do anything of
> > important! It is
> > alone a test.
> >
> > what we most can do?
> >
> > I changed the command for "DIR" who list the directories of the
> > windows just
> > to facilitate the comprehension and so that it to do not are
> > necessary to do
> > an upload of sound.exe. Try, with that program execute some other
> > command!
> > Here, already tried of everything, and anything (not) worked.
> >
> >
> > *************************************************
> >
> > #include <stdlib.h>
> > #include <math.h>
> > #include <stdio.h>
> >
> > main()
> > {
> > int a,b,c,d,e,f,g,h,j;
> >
> > FILE *stream;
> >
> > printf("Programa Gerador de Resultados para Teste:");
> > printf("\n\nEntre com as Faixas");
> > printf("\nNumero a ser comparado: ");scanf("%d",&c);
> > printf("\n....................De: ");scanf("%d",&a);
> > printf("\n.....................A: ");scanf("%d",&b);
> >
> > d = c;
> > f = a;
> > g = b;
> >
> > j = 1;
> >
> > while(g <= c){
> > e = f * g;
> > h = d - e;
> > if((stream = fopen("dtr1.txt", "at")) != NULL){
> > fprintf(stream,"\n %d * %d = %d -r = %d",f,g,e,h);
> > }
> > fflush(stdout);
> > fclose(stream);
> > if(j >= c){
> > f = a;
> > j = 0;
> > g++;
> > printf("\nF: %d\tG %d:",f,g);
> > fflush(stdout);
> > }
> > f++;
> > j++;
> > }
> >
> > if((system("dir")) == 0){
> > printf("\n\nComando executado com sucesso");
> > }
> > else{
> > printf("\n\ncomando falhou");
> > }
> >
> > }
>
> This program will not work. There is no program called 'dir' in Windows. You
> probably want something like 'cmd /c dir'.
>
> Chris
Ah, but there is a "dir.exe" in fileutils on Cygwin. IOW, the following
worked for me:
$ cat > moises.c
#include <stdlib.h>
main() {
system("dir");
}
$ make moises
gcc moises.c -o moises
$ ./moises
moises.c moises.exe
$
At a guess, the OP is not using gcc or Cygwin at all. If so, the question
is off-topic for this list.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: system() refuses to work!!! HELP
[not found] <E1A9eYj-0000oV-00@m1.dnsix.com>
@ 2003-10-15 9:10 ` Chris January
2003-10-15 15:09 ` Igor Pechtchanski
0 siblings, 1 reply; 9+ messages in thread
From: Chris January @ 2003-10-15 9:10 UTC (permalink / raw)
To: Cygwin@Cygwin.Com
> It did not work. Will it be that I found a bug??? How much luck I
> have.. :-)
> It follows the source. that program does not do anything of
> important! It is
> alone a test.
>
> what we most can do?
>
> I changed the command for "DIR" who list the directories of the
> windows just
> to facilitate the comprehension and so that it to do not are
> necessary to do
> an upload of sound.exe. Try, with that program execute some other
> command!
> Here, already tried of everything, and anything (not) worked.
>
>
> *************************************************
>
> #include <stdlib.h>
> #include <math.h>
> #include <stdio.h>
>
> main()
> {
> int a,b,c,d,e,f,g,h,j;
>
> FILE *stream;
>
> printf("Programa Gerador de Resultados para Teste:");
> printf("\n\nEntre com as Faixas");
> printf("\nNúmero a ser comparado: ");scanf("%d",&c);
> printf("\n....................De: ");scanf("%d",&a);
> printf("\n.....................A: ");scanf("%d",&b);
>
> d = c;
> f = a;
> g = b;
>
> j = 1;
>
> while(g <= c){
> e = f * g;
> h = d - e;
> if((stream = fopen("dtr1.txt", "at")) != NULL){
> fprintf(stream,"\n %d * %d = %d -r = %d",f,g,e,h);
> }
> fflush(stdout);
> fclose(stream);
> if(j >= c){
> f = a;
> j = 0;
> g++;
> printf("\nF: %d\tG %d:",f,g);
> fflush(stdout);
> }
> f++;
> j++;
> }
>
> if((system("dir")) == 0){
> printf("\n\nComando executado com sucesso");
> }
> else{
> printf("\n\ncomando falhou");
> }
>
> }
This program will not work. There is no program called 'dir' in Windows. You
probably want something like 'cmd /c dir'.
Chris
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: system() refuses to work!!! HELP
@ 2003-10-15 7:46 Moises D. Deangelo
0 siblings, 0 replies; 9+ messages in thread
From: Moises D. Deangelo @ 2003-10-15 7:46 UTC (permalink / raw)
To: cygwin
It did not work. I do not manage to understand what happens of wrong.
Em 14 Oct 2003, Andrew DeFaria escreveu:
>Moises D. Deangelo wrote:
>
>> Yes.
>>
>> When entering with the command ls -l /bin/sh.exe, the appeared following:
>>
>> -rwxr-x---+ 1 Diego Usuários 83456 Aug 11 10:45 /bin/sh.exe
>>
>>
>> And now? what Do I do? Does that mean something? How I said, or the
>> command system() works, or I learn to activate speaker through cygwin.
>> In ultimo case, whether someone knows how to execute a .WAV or .MP3
>> and can explain am thankful.
>
>You could try system("/bin/cat .wav > /dev/dsp"). Note that this
>does not handle mp3's just wav's.
>
>(Note that /bin/cat will probably not work for a Turbo C program because
>/bin/cat is a Posix path. You might need to do something more like
>system("C:\Cygwin\bin\bash -c '/bin/cat .wav > /dev/dsp'"). Also
>note that you need to subsititute a real wav file name for .wav).
>
>--
>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>Problem reports: http://cygwin.com/problems.html
>Documentation: http://cygwin.com/docs.html
>FAQ: http://cygwin.com/faq/
>
>----------
_________________________________________________________
Voce quer um iGMail protegido contra vÃrus e spams?
Clique aqui: http://www.igmailseguro.ig.com.br
Ofertas imperdÃveis! Link: http://www.americanas.com.br/ig/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: system() refuses to work!!! HELP
[not found] <E1A9czu-00067Y-00@quimby.gnus.org>
@ 2003-10-15 5:50 ` Andrew DeFaria
0 siblings, 0 replies; 9+ messages in thread
From: Andrew DeFaria @ 2003-10-15 5:50 UTC (permalink / raw)
To: cygwin
Moises D. Deangelo wrote:
> Yes.
>
> When entering with the command ls -l /bin/sh.exe, the appeared following:
>
> -rwxr-x---+ 1 Diego Usuários 83456 Aug 11 10:45 /bin/sh.exe
>
>
> And now? what Do I do? Does that mean something? How I said, or the
> command system() works, or I learn to activate speaker through cygwin.
> In ultimo case, whether someone knows how to execute a .WAV or .MP3
> and can explain am thankful.
You could try system("/bin/cat <file>.wav > /dev/dsp"). Note that this
does not handle mp3's just wav's.
(Note that /bin/cat will probably not work for a Turbo C program because
/bin/cat is a Posix path. You might need to do something more like
system("C:\Cygwin\bin\bash -c '/bin/cat <file>.wav > /dev/dsp'"). Also
note that you need to subsititute a real wav file name for <file>.wav).
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: system() refuses to work!!! HELP
[not found] <200310150410.h9F4AXM31666@mx1.redhat.com>
@ 2003-10-15 5:21 ` Christopher Faylor
0 siblings, 0 replies; 9+ messages in thread
From: Christopher Faylor @ 2003-10-15 5:21 UTC (permalink / raw)
To: cygwin
On Wed, Oct 15, 2003 at 01:10:08AM -0300, Moises D. Deangelo wrote:
>When entering with the command ls -l /bin/sh.exe, the appeared following:
>
>-rwxr-x---+ 1 Diego Usu?rios 83456 Aug 11 10:45 /bin/sh.exe
Ok. The next question is if "sound.exe" is in your path. Does something
like:
system("/cygdrive/c/dir/sound.exe")
work?
/cygdrive/c/dir would be cygwin's way of typing c:/dir
dir would be the place where sound.exe lives.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: system() refuses to work!!! HELP
@ 2003-10-15 4:25 Moises D. Deangelo
0 siblings, 0 replies; 9+ messages in thread
From: Moises D. Deangelo @ 2003-10-15 4:25 UTC (permalink / raw)
To: cygwin
Yes.
When entering with the command ls -l /bin/sh.exe, the appeared following:
-rwxr-x---+ 1 Diego Usuários 83456 Aug 11 10:45 /bin/sh.exe
And now? what Do I do? Does that mean something? How I said, or the command
system() works, or I learn to activate speaker through cygwin. In ultimo
case, whether someone knows how to execute a .WAV or .MP3 and can explain am
thankful.
The important is that my program of a sonorous warning when I need.
Thanks.
As usual, apologizing me for bad English.
Moises Deangelo.
Brazil.
>Do you have the file /bin/sh.exe on your system?
>
>ls -l /bin/sh.exe
>
>would tell you.
Em 14 Oct 2003, cygwin@cygwin.com escreveu:
>On Tue, Oct 14, 2003 at 10:50:35PM -0200, Moises D. Deangelo wrote:
>>Hi Personal.
>>
>>Please, my program keep working for several and several hours.
>>I want when he finish, which he warns me. To do not complicate my work
wish
>>to activate speaker, but I do not have been having success.
>>
>>I use platform w2k, and clear, cygwin.
>>
>>As I do not manage to activate speaker by cygwin, tried by the Turbo C.
>>
>>But my program is done in cygwin, and it does not run in TC. I tried to
>>place in the source of my program
>>system(sound.exe).
>>
>>Sound.exe is developed in TC and would be the program that activates
>>speaker.
>>
>>This way, when my program finished, he would call that other program
>>sound.exe that then it would activate speaker.
>>
>>But system() refuses to work.
>>
>>Summarizing. Or I activate speaker using cygwin, or I manage to do cygwin
>>call a program that can activate.
>>
>>Can anybody help?
>>
>>Apologize me for my bad English.
>
>--
>Please use the resources at cygwin.com rather than sending personal email.
>Special for spam email harvesters: send email to aaaspam@sourceware.org
>and be permanently blocked from mailing lists at sources.redhat.com
>
>--
>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>Problem reports: http://cygwin.com/problems.html
>Documentation: http://cygwin.com/docs.html
>FAQ: http://cygwin.com/faq/
>
>----------
_________________________________________________________
Voce quer um iGMail protegido contra vÃrus e spams?
Clique aqui: http://www.igmailseguro.ig.com.br
Ofertas imperdÃveis! Link: http://www.americanas.com.br/ig/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: system() refuses to work!!! HELP
[not found] <200310150050.h9F0ogM22662@mx1.redhat.com>
@ 2003-10-15 2:38 ` Christopher Faylor
0 siblings, 0 replies; 9+ messages in thread
From: Christopher Faylor @ 2003-10-15 2:38 UTC (permalink / raw)
To: cygwin
On Tue, Oct 14, 2003 at 10:50:35PM -0200, Moises D. Deangelo wrote:
>Hi Personal.
>
>Please, my program keep working for several and several hours.
>I want when he finish, which he warns me. To do not complicate my work wish
>to activate speaker, but I do not have been having success.
>
>I use platform w2k, and clear, cygwin.
>
>As I do not manage to activate speaker by cygwin, tried by the Turbo C.
>
>But my program is done in cygwin, and it does not run in TC. I tried to
>place in the source of my program
>system(sound.exe).
>
>Sound.exe is developed in TC and would be the program that activates
>speaker.
>
>This way, when my program finished, he would call that other program
>sound.exe that then it would activate speaker.
>
>But system() refuses to work.
>
>Summarizing. Or I activate speaker using cygwin, or I manage to do cygwin
>call a program that can activate.
>
>Can anybody help?
>
>Apologize me for my badly English.
Do you have the file /bin/sh.exe on your system?
ls -l /bin/sh.exe
would tell you.
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to aaaspam@sourceware.org
and be permanently blocked from mailing lists at sources.redhat.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
* system() refuses to work!!! HELP
@ 2003-10-15 2:05 Moises D. Deangelo
0 siblings, 0 replies; 9+ messages in thread
From: Moises D. Deangelo @ 2003-10-15 2:05 UTC (permalink / raw)
To: cygwin
Hi Personal.
Please, my program keep working for several and several hours.
I want when he finish, which he warns me. To do not complicate my work wish
to activate speaker, but I do not have been having success.
I use platform w2k, and clear, cygwin.
As I do not manage to activate speaker by cygwin, tried by the Turbo C.
But my program is done in cygwin, and it does not run in TC. I tried to
place in the source of my program
system(sound.exe).
Sound.exe is developed in TC and would be the program that activates
speaker.
This way, when my program finished, he would call that other program
sound.exe that then it would activate speaker.
But system() refuses to work.
Summarizing. Or I activate speaker using cygwin, or I manage to do cygwin
call a program that can activate.
Can anybody help?
Apologize me for my badly English.
Moises Deangelo
Brazil.
_________________________________________________________
Voce quer um iGMail protegido contra vÃrus e spams?
Clique aqui: http://www.igmailseguro.ig.com.br
Ofertas imperdÃveis! Link: http://www.americanas.com.br/ig/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-10-15 14:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 6:34 system() refuses to work!!! HELP Moises D. Deangelo
[not found] <E1A9eYj-0000oV-00@m1.dnsix.com>
2003-10-15 9:10 ` Chris January
2003-10-15 15:09 ` Igor Pechtchanski
-- strict thread matches above, loose matches on Subject: below --
2003-10-15 7:46 Moises D. Deangelo
[not found] <E1A9czu-00067Y-00@quimby.gnus.org>
2003-10-15 5:50 ` Andrew DeFaria
[not found] <200310150410.h9F4AXM31666@mx1.redhat.com>
2003-10-15 5:21 ` Christopher Faylor
2003-10-15 4:25 Moises D. Deangelo
[not found] <200310150050.h9F0ogM22662@mx1.redhat.com>
2003-10-15 2:38 ` Christopher Faylor
2003-10-15 2:05 Moises D. Deangelo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).