Hi everybody,
How can I check in my ULP if a file exist or not?
Thanks in advance for your answers!
Jean-Louis
Hi everybody,
How can I check in my ULP if a file exist or not?
Thanks in advance for your answers!
Jean-Louis
Hi,
try something like this:
int FileExists(string name)
{
string files[];
return (fileglob(files, name) != 0);
}
Rene
I try this:
int x;
string etxt;
int FileExists( string name )
{
string files[];
return (fileglob(files, name) != 0);
}
x = FileExists("C:\test.txt");
sprintf(etxt,"%d",x);
dlgMessageBox(etxt);
My problem is that x is always 0 that file exists or not.
Do you have an idea?
Am 30.11.2012 12:16, schrieb Jean-Louis Tharin:
x = FileExists("C:\test.txt");
This is a C style language, hence you have to write:
x = FileExists("C:
test.txt");
Like this you have a problem of syntax of string
This is a C style language, hence you have to write:
x = FileExists("C:
test.txt");
The Solution is:
int x;
string etxt;
int FileExists( string name )
{
string files[];
return (fileglob(files, name) != 0);
}
x = FileExists("C:/test.txt");
sprintf(etxt,"%d",x);
dlgMessageBox(etxt);
I need to use a "slash" and not a "back slash"!
Thanks to you for your help!