[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: FTP a save file from one iSeries to another



Sender: "Richard Lambert" <rlambert@xxxxxxxxxxxxxxxx>

Hi Scott,

My program is based on the TESTMGET example which list all files in a
library on the FTP server (iSeries) then get the files one by one.  All of
the files in this library should be save files.

At the time that I run this program, the save files will not exist on the
local system and I would like FTPAPI to create them (or I can create them in
my program in necessary).

I tried to create the save file prior to issuing FTP_GET(), but I have run
into another snag.  GetFileAtr() is now returning the proper attribute,
however the next step in OpenFile() is to create the save file if the
attribute (wwAttr) = SAVF.  Since I have already created the file, boom.

I will do more research on what changes would be required to GetFileAtr()
and/or OpenFile() to get this to work.  If I come up with something, I will
forward it to you.

If anyone has any other suggestions, I would love to hear them.

Thanks,

Richard Lambert
Bison Information Systems Inc.


-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On
Behalf Of Scott Klement
Sent: Friday, March 25, 2005 12:24 PM
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: FTP a save file from one iSeries to another

Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


> I have been trying to use FTP_GET() to pick up a save file from 
> another iSeries.  When the file is retrieved, it has the PF-DTA 
> attributes instead of the SAVF attributes.


So, I'm guessing (please confirm this or clarify) what you're doing is

           x = FTP_get(y: 'path on server'
                        : '/qsys.lib/mylib.lib/mysavf.savf')

At the time you run this, mysavf doesn't exist, and you want FTPAPI to
create it as a save file.  Is that correct?

> Looking at the OpenFile() source (which is called by FTP_GET()) it 
> calls
> ParsePath() which returns *SAVF.  This is then passed to GetFileAtr() 
> which actually creates the file.  Unfortunately, the first thing
GetFileAtr() does
> is clobber the SAVF attribute with "eval      peAttrib = *blanks".

Yeah, that's obviously not what was intended.  I think, originally,
GetFileAtr() was only being called for files that already existed. Files
that didn't exist didn't have an attribute, so used the defaults of PF or
SAVF.

Somewhere along the way, it was changed to always call GetFileAtr() and have
it create the files that didn't exist, which broke this behavior (but
probably fixed something else)

OpnFile() started as a very simple subprocedure, and it's turned into an
absolute mess! :)  That whole thing needs to be broken into smaller pieces
and made easier to cope with.

>
> Do I need to modify the GetFileAtr() procedure or is there another way of
> retrieving save files from another iSeries?

I should really fix OpnFile(), but if you want a quick workaround, just 
create the SAVF ahead of time. Then the file will exist, and GetFileAtr() 
will return an attribute of SAVF (since it will actually be one!)

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------