Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Copying file from Unix directory to a Shared Windows directory

Former Member
0 Kudos

Hello All,

I want to copy a PDF file that resides in a Unix directory, say /usr/home/file.pdf, to a shared windows directory, say
itm\Copy\PDF\. How can I achieve this?

The size of file may be varying, also are there complications due to difference in line feed format?

Thanks for your help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

For Shell you can use something like this, uf you can connect in ftp to windows machine (otherwise, delete ftp command):

#! /bin/sh

#

SRC_DIR=/usr/home/

SRC_FILENAME=file.pdf

TRG_HOSTNAME=<hostname>

TRG_DIR=
itm\Copy\PDF\

TRG_FILENAME=file.pdf

cd $SRC_DIR

ftp -n -v <<%%EOF%%

open TRG_HOSTNAME

user <user> <pass>

cd $TRG_DIR

put $SRC_FILENAME $TRG_FILENAME

bye

%%EOF%%

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

You have to write a unix command ( must contain code which moves the file from one place to other ) and execute it using function SXPG_COMMAND_EXECUTE. Please search the forum for more details.

basis people having knowledge of UNIX can easily write this

Former Member
0 Kudos

For Shell you can use something like this, uf you can connect in ftp to windows machine (otherwise, delete ftp command):

#! /bin/sh

#

SRC_DIR=/usr/home/

SRC_FILENAME=file.pdf

TRG_HOSTNAME=<hostname>

TRG_DIR=
itm\Copy\PDF\

TRG_FILENAME=file.pdf

cd $SRC_DIR

ftp -n -v <<%%EOF%%

open TRG_HOSTNAME

user <user> <pass>

cd $TRG_DIR

put $SRC_FILENAME $TRG_FILENAME

bye

%%EOF%%

0 Kudos

I was wondering if this can be done through report program?

0 Kudos

Yes. You have to write a unix command externally and call it thorugh the function in your report.

check