walter01
10th September 2009, 13:59
From the Baan server I want to rename a file on the client pc. How do I do this ?
And what's the syntax for file.mv.across.hosts ?
How do I specify a a hostname in the source and destination strings ?

thanks,

Walter

bdittmar
10th September 2009, 14:01
From the Baan server I want to rename a file on the client pc. How do I do this ?
And what's the syntax for file.mv.across.hosts ?
How do I specify a a hostname in the source and destination strings ?

thanks,

Walter

Hello,

file.mv.across.hosts()

--------------------------------------------------------------------------------

Syntax
long file.mv.across.hosts( const string source, const string target )

Description
This moves a specified source file to the location specified in the target argument. The file can be either local or remote. Source and target can be on different hosts.

Return values
1 Success.

<0 Error.

walter01
10th September 2009, 14:18
Thanks bdittmar,

I've read the help file but can you give me an example of the source and/or target strings if I want to copy file A to B on server S ?

Walter

mark_h
10th September 2009, 15:44
I never could get that remote host to work. What I typically do is copy the file to the server. Have you tried building a cmd statement and using app_start to launch it? I think there are some examples on this board. Or a longer method - client2server, remove.local.file,server2client(with new name).

walter01
10th September 2009, 15:50
Thanks Mark,

Your'e longer method is clear to me. I was hoping file.mv() would be a nice short way to get the job done.

Walter

mark_h
10th September 2009, 15:58
Actually it is, but I could never get the host pieces to work. Somehow the client has to be a trusted host on the server and their was no way our UNIX admins were going to let that happen. So i gave up on that method of doing things with the client.

dhowells
10th September 2009, 22:00
Try this:

string command.line(100)

command.line = "cmd /c move c:\temp\file.txt c:\temp2\file.txt"
e = run.prog("cmd.exe", command.line, rp_wait)

walter01
11th September 2009, 09:58
Thanks dhowells,

I'm not sure if that would work. I'm running Baan on Unix and want to move the file on the Windows client pc.

george7a
11th September 2009, 14:59
It should work. However, it will open a black screen (the cmd window) infort of the user for less than a second and then close it..