alejandro
30th May 2002, 14:48
I am trying to delete a file located in the server from a script. The code I use reads:

ret=shell("rm "&quearch,64)

Where quearch is a string variable containig full file path.
What I see is that this action takes a lot of time, maybe because I am calling shell emulator.

The question is:

¿Is there a function in tt or in 4GL function to delete a file in the server, more efficiently?

I am looking for something similar to remove.local.file (ttdllbw), but must be in server, something like "remove.server.file"??.

Thanks.

PS BaaN IV & UNIX

evesely
30th May 2002, 16:07
There is a function file.rm that does this. Here is the usage:

long file.rm(const string path)

It should return a 1 if successful and a negative value on a failure.

I hope that helps.

alejandro
30th May 2002, 16:19
Yes.

Thank you very much. That was exactly what I was looking for.

Han Brinkman
30th May 2002, 18:28
seq.unlink(path)

that the one I always use, it's documented and I am not sure if file.rm() is supported in later versions.

Regards,
Han

~Vamsi
30th May 2002, 19:07
Han,

I believe both for them are supported. I end up using seq.unlink when I am using seq.open/seq.puts/seq.close statements and file.rm when just doing directory/file operations.