avpatil
1st August 2002, 16:33
Hi,
Is there a function to delete file on a remote machien on network. We are on NT. I tried using "remove.local.temp.file()". I am not sure what should be the value of two paremeters. One is path and other is local path.

Any inputs

Thanks

Arvind Patil

patvdv
1st August 2002, 16:53
Have a look at http://www.baanboard.com/programmers_manual_baanerp_help_functions_client_file_access_remove_local_file

avpatil
1st August 2002, 17:17
Hi,
I cannot complie the program if I use remove.local.file(). I have included the statement- #pragma used dll ottdllbw also in my dll. I am on Baan IVc3.

Thanks

Arvind Patil

mark_h
1st August 2002, 18:32
Arvind,

I do not think this is available on 4c3. I checked my ttdllbw and it is not in there. I also can not find any help on this command. We are also on 4c3.

Mark

mark_h
1st August 2002, 18:59
You could write you own application to delete a local client file and use app_start to run it while passing the file name as a parameter. I did a quick test using a .bat file that hade erase %1 in it. I then used rc = app_start("C:\baan_old\TMP\rmfile C:\baan_old\TMP\perfdetails.txt","","","","") in a test script. It did delete the local file. There probably is a better way, but this came to mind first. Please let us know what your final solution is.

Good Luck!

Mark

NPRao
1st August 2002, 19:13
Hi Arvind,

Did you try the http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_file_rm the baan standard function ?

you can also consider -


remove.local.temp.file
long remove.local.temp.file( const string path(), ref string local.path() )
pre: local.path is temporary local path for path; local.path is
created by function create.local.temp.file.
post: If path is local (so local.path = path) then nothing will be done.
If path is not local this function removes the temporary file local.path.
return: 0 if path is local, otherwise the return value for
seq.unlink(local.path)


This function is found in the tools dll -

Library ttdllfilehand
File Handling, also working for remote
(38 Functions available)

avpatil
1st August 2002, 20:50
Hi,
My question was to remove or delete the file on remote machie. I tried using remove.local.temp.file() but I was not sure what the parameter means. While, I did this in a round about way. I create a bat file in which I wrote to delete all the files that I need to delete and also a line to delete the bat file itself. It runs and it deletes all the file that I want to delete. Only thing is I am using seq.puts to write into the bat file. I need to have "enter" after evry delelte line ( I am deleting 3 files).

Thanks

Arvind Patil

NPRao
1st August 2002, 21:11
Hi Arvind,

I think you can do that with the file.rm() function. Please refer to the help manual.

To access/copy/remove files across hosts/servers, you need to set up the remote user data.

I didnt quite understand what do you mean by ?

I need to have "enter" after evry delelte line ( I am deleting 3 files).


If you are facing a problem putting text in different lines with seq.write.local(), please refer to the posting -

http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5881

You can look up the available functions in a tools dlls by using the $ bic_info(version) ottdllfilehand or use the session, ttstpbaandoc.


remove.local.temp.file
long remove.local.temp.file( const string path(), ref string local.path() )
pre: local.path is temporary local path for path; local.path is
created by function create.local.temp.file.
post: If path is local (so local.path = path) then nothing will be done. If path is not local this function removes the temporary
file local.path.
return: 0 if path is local, otherwise the return value for
seq.unlink(local.path)

create.local.temp.file
long create.local.temp.file( const string path(), ref string local.path() )
post: If path denotes a remote file, this function has copied the contents of that file to a temporary file local.path,
created in bse.tmp.dir$. If path denotes a local file, local.path = path.
return: If an error occurs when copying the file to local,
then true is returned, otherwise false is returned.
note: local.path should be removed using remove.local.temp.file (using seq.unlink may result in a serious error).


Hope this helps you out.

mark_h
1st August 2002, 21:47
Avrind,

I think NPR answered your question with the link. It talks about the chr$(10) and chr$(13) use.

Then again you could just use one line -
erase file1 file2 file3. Of course you need to have the path to each of the files.

As to NPR's other suggestion the file.rm sounds good if you can get the security setup between the clients and the servers. I am not sure what that takes - I can not test this because our security between hosts(UNIX) and between clients(W2K) is restricted.


Mark