suhas-mahajan
28th October 2004, 01:30
Hi All,
I am trying to open a server side text file using notepad.exe using following command :
app.id = app_start("notepad.exe "& "\\REPL\baan\tmp\" & shiftl$(shiftr$(l.user)) &".txt" , "", "", "", "")
but the limitation of above code is I have to hardcode name of server, since I have to deploy it on diff. servers where I cannot change code.
Any idea? I reffered lot discussed posts here but still unsuccess.
Regards,
-Suhas
NPRao
28th October 2004, 02:27
Suhas,
I am not sure of your requirements.
If you cant open the server side file then copy it to the local disk.
target = "c:\temp\" & filename
e = server2client(fpath, target, false, true)
if not e then
app.id = app_start("notepad " & target, "", "", "", "")
while app_status(app.id)
suspend(3000)
|* Wait 3 seconds before checking the next time
endwhile
remove.local.file(target)
else
mess("zmadms0020", 1)
|* Error - source file not copied to the destination file
endif
You can also use the ftp script options.
Also refer to - file.cp() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_file_cp)
but the limitation of above code is I have to hardcode name of server, since I have to deploy it on diff. servers where I cannot change code.
If you dont like hard-coding then its easier to make a table for all the server entires and then read it from your problem based on some conditions/selections etc.
Here is an example from our environment.
suhas-mahajan
28th October 2004, 05:28
Thanks for the prompt reply, Sir.
Yes, I could use your code which you already posted somewhere.
But, ones I copied the file to clientside the data will saved clientside, whereas I want to keep it updated on serverside for next updation.
And about your second solution - it will big thing to achive a small task, so I am looking alternate, because we are avoiding table creation for future big maintenance.
Regards.
-Suhas
mark_h
28th October 2004, 16:29
Just some thoughts, but in our division all of the sites have a common mapped drive. So k:\common is there for everybody, but it is mapped to the users home server. Is it possible for you all to do something like this? Then you would only need to know the drive. Or maybe even have a variable created on the client with the server name for the Baan tmp directory? These type things depend on the client setup.
Mark
suhas-mahajan
3rd November 2004, 10:15
Thanks for the info.
I got your solution of common drive, but it will increase dependancy just for opening a server side file.
Also give more info. on -
Or maybe even have a variable created on the client with the server name for the Baan tmp directory? These type things depend on the client setup.
Regards,
-Suhas