Dear Friends,

I am developing a small project in which the users have to fill a form from which it will be saved into a database.

Here i wanted to scan a particular folder in the hard-drive contineously so as to know if there is any new file saved in it.

Hence i have written a program(program 1) to do this task and i want to call this program in another c program which collects the data from users and hence while the users are filling the form,the program 1 would contineously scan the hard-drive so as to detect a particular file and if present would flash a message to the user.

I have tried using system command but to no use.

Please help.

Note : I am using Borland Turboc3 3.0 compiler.

Thanks & Regards
Rituraj Raina

Recommended Answers

All 9 Replies

>I have tried using system command but to no use.
How did you try it? Is this in a separate thread? Does it not work because of a syntax error or something else? Be as specific as possible and give code examples. Otherwise you'll get nothing but stoney silence.

>Note : I am using Borland Turboc3 3.0 compiler.
Jeez, get a newer compiler. :rolleyes:

I have tried using system command but to no use.
How did you try it? Is this in a separate thread? Does it not work because of a syntax error or something else? Be as specific as possible and give code examples. Otherwise you'll get nothing but stoney silence.

Note : I am using Borland Turboc3 3.0 compiler.

Jeez, get a newer compiler. :rolleyes:

Dear Narue,
Here is the section of the code that i used :

#include<cstdlib>
#include <stdio.h>
#include<conio.h>
#include<process.h>


int main(void)
{
    clrscr();
    printf("About to spawn command interpreter and run a DOS command\n");
    system("dir");
    getch();
    return 0;
}

When executed ,it just shows on the screen the string written in printf when i include file #include<stdlib.h>

When i tried using #include<cstdlib.h> or #include<cstdlib> then it flashes an error: "Unable to include file cstdlib.h or cstdlib.

If you have some solution then kindly help.

Also if i were to upgrade the compiler ,then which compiler should i use and from where i can get one?

Hi, Riturajraina

I tried your piece of code in Dev-C++ 4.9.9.0 compiler (available for free download at www.bloodshed.net), and it's working just fine (just delete the clrscr command)...

I ment replace clrscr() with system ("cls") (it's equivalent, and it does another system call for you :cool: )

>If you have some solution then kindly help.
Get a newer compiler. Your problem is that you're trying to use modern C++ with an ancient compiler that doesn't know what modern C++ is.

>then which compiler should i use and from where i can get one?
Dev-C++ is a good one. Search google for Bloodshed's web site where you can download it for free.

Dear Narue/Frrossk,

Thanks for all your help.

I have downloaded Dev compiler and executed the system command which worked fine.

But now i am facing a new problem.

I tried to compile the c++ source code files which i have written in the Turboc3 3.0 compiler .It is flashing a no. of error messages like "In file included in file goto.cpp" etc.

When i compile the same source files in Turboc3 3.0 compiler,then it doesn't display any error messages and the program is executing fine.

I am sorry to trouble you again & again but request you to please get me out of this.

Its a very embarassing situation.

Thanks again
Rituraj

>But now i am facing a new problem.
Post one of the programs that doesn't compile with Dev-C++ and does with Turbo C++. Most likely you're using a library that extension that Dev-C++ doesn't support.

i suppose i may give you a solution. are you an intermediate user of C? if so then try in this way-

1. go to run
2. use command.com to execute
3. go to tc.exe by providing entire path of the TC compiler folder
4. #include<dos.h> in your code and compile your code
5. then go to exit from the TC compiler. file -> exit option
6. now u r in dos prompt again
7. write the name of program exe and then you will find the out put that will show the sub directories of the current directories.

please do let me know whether it worked or not?

>please do let me know whether it worked or not?
Factoring in that this thread is four years old and the OP hasn't posted in two years, I'd say that's unlikely.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.