Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Marton
Sounds great, Arkady. I'm glad my code at least helped to see the bug. Please let me know if/when you fix it so I try it :) Thanks!! Marton Arkady V.Belousov wrote: > > Hi! > > 18-Сен-2006 15:29 [EMAIL PROTECTED] (Marton) wrote to > freedos-user@lists.sourceforge.net: > > M> Absolutely, the

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Daniel Franzini
wellthis is not the "right" way to do what you want to do...altough it seems to work, despite any possible problems with FreeCOMDOS has its own, more elegant, API for file/directory listing...look for functions findfirst/findnext...they should be avaliable on your C compiler... On 9/18/06, Marton <

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Arkady V.Belousov
Hi! 18-Сен-2006 15:29 [EMAIL PROTECTED] (Marton) wrote to freedos-user@lists.sourceforge.net: M> Absolutely, the function is simple... just to see if two directories that M> should have the same contents changed. Here it goes (hope it indents well): M> int checkdir(void) { [...] M> system("di

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Marton
Absolutely, the function is simple... just to see if two directories that should have the same contents changed. Here it goes (hope it indents well): int checkdir(void) { int i, filesize = 0; FILE *fp, *fp2; system("dir c:\\data\\base1 >c:\\data.dir"); fp = fopen("c:\\data.dir","

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Arkady V.Belousov
Hi! 18-Сен-2006 11:21 [EMAIL PROTECTED] (Marton) wrote to freedos-user@lists.sourceforge.net: M> I tried that exact version, when I type "ver" I get "FreeCom version M> 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00]"... and the issue still M> happens... Current FreeCOM deals with "/c" option

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Marton
I tried that exact version, when I type "ver" I get "FreeCom version 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00]"... and the issue still happens... Arkady V.Belousov wrote: > > Hi! > > 18-Сен-2006 04:44 [EMAIL PROTECTED] (Marton) wrote to > freedos-user@lists.sourceforge.net: > > M> With "c

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Blair Campbell
That would be the edition. On 9/18/06, Arkady V.Belousov <[EMAIL PROTECTED]> wrote: > Hi! > > 18-Сен-2006 04:44 [EMAIL PROTECTED] (Marton) wrote to > freedos-user@lists.sourceforge.net: > > M> With "current" you mean 1.0, or the latest build? 'cause I tried 1.0 > without > M> luck... > >> Tro

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Arkady V.Belousov
Hi! 18-Сен-2006 04:44 [EMAIL PROTECTED] (Marton) wrote to freedos-user@lists.sourceforge.net: M> With "current" you mean 1.0, or the latest build? 'cause I tried 1.0 without M> luck... >> Trouble not in "delay for flush", trouble that (old) FreeCOM was >> buggy. >> Current FreeCOM deals with

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Marton
With "current" you mean 1.0, or the latest build? 'cause I tried 1.0 without luck... Thanks!! Marton Arkady V.Belousov wrote: > > Hi! > > 16-Сен-2006 08:43 [EMAIL PROTECTED] (Marton) wrote to > freedos-user@lists.sourceforge.net: > > M> Many thanks for the suggestions but instead of doing s

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-18 Thread Arkady V.Belousov
Hi! 16-Сен-2006 08:43 [EMAIL PROTECTED] (Marton) wrote to freedos-user@lists.sourceforge.net: M> Many thanks for the suggestions but instead of doing stuff in my code... M> couldn't we somehow add a delay to FreeCOM before it exits (when called with M> /c) so everything gets flushed and it works

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-17 Thread Marton
Many thanks for the suggestions but instead of doing stuff in my code... couldn't we somehow add a delay to FreeCOM before it exits (when called with /c) so everything gets flushed and it works for everyone? Under command.com everything works as-is and it is a crime to patch my code instead of doi

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Arkady V.Belousov
Hi! 16-Сен-2006 09:12 [EMAIL PROTECTED] (Blair Campbell) wrote to freedos-user@lists.sourceforge.net: BC> I did say that there were ways to save/restore the original stdout... But you not explain this for man, to whom you answer. BC> I know that open("CON") is technically wrong, but at the

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Blair Campbell
I did say that there were ways to save/restore the original stdout... I know that open("CON") is technically wrong, but at the same time it works in most cases. On 9/16/06, Arkady V.Belousov <[EMAIL PROTECTED]> wrote: > Hi! > > 16-Сен-2006 02:29 [EMAIL PROTECTED] (Blair Campbell) wrote to > freedo

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Arkady V.Belousov
Hi! 16-Сен-2006 02:29 [EMAIL PROTECTED] (Blair Campbell) wrote to freedos-user@lists.sourceforge.net: BC> Hi. It almost sounds to me like the destination file isn't getting BC> flushed to the disk. I would recommend doing the recirection BC> internally in the C program, and then you have direct

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Johnson Lam
On Sat, 16 Sep 2006 02:29:02 -0700, you wrote: Hi Blair, Thanks. Sent him email. >Hi. It almost sounds to me like the destination file isn't getting >flushed to the disk. I would recommend doing the recirection >internally in the C program, and then you have direct control of the >file. A sim

Re: [Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Blair Campbell
Hi. It almost sounds to me like the destination file isn't getting flushed to the disk. I would recommend doing the recirection internally in the C program, and then you have direct control of the file. A simple close(1); open("blah", O_WRONLY); /* system() stuff here: */ blah blah blah close(1)

[Freedos-user] Need help ... calling COMMAND.COM from C

2006-09-16 Thread Johnson Lam
Hi, Please help Marton (marton=at=argentina.com), he stuck with a C program calling COMMAND.COM: Now that I moved onto my next step on my project, another issue arised... If I run this: TestDir.bat: dir /b c:\testdir >d:\dirout.put The file dirout.put has the directory output... BUT, if I