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

RE: file not found



Sender: Scott Klement <klemscot@xxxxxxxxxxxx>


Hi,

On Mon, 20 May 2002, Angela Wawrzaszek wrote:
>
> 2.  When I said I ran the TESTGET and got host not found - I was running
> it from a as/400 session, even though I said I ran it from my PC.  I was
> just saying from the as/400 session it gives me a host not found BUT if
> I open a dos window and Manually type in the ftp commands for the test
> server in the TESTGET it works.
>

What if you manually type those same commands on your AS/400?  FTPAPI
just uses the system's host lookup API, if anything's wrong with a DNS
lookup, it seems likely that it's a difference in how your AS/400's
DNS is set up vs. the way the PC is set up.

>
> So I did change the root directory to go to the directory I want and I
> have the MyFTPGET program doing what I want now.  So now I am tackling
> the TESTPUT.  I changed the program to upload the file from the IFS
> directory that MyFTPGET program put there.  I am now trying to upload
> that to the as/400.  I changed the directory to be
> 'qsys.lib/austeellib.lib/vmifile.file/vmifile.mbr'
>
> The program runs and ends with 'File transfer ended successfully'
> However the file on the as/400 is empty.  I also have to run the
> MyFTPGET everytime to put the file back in the IFS directory.
> Otherwise it is empty after running the MyFTPPUT program is that normal?

No, that's not normal.    It kinda sounds like you're doing a GET instead
of a PUT.  i.e. it's downloading the empty file, and using that to replace
the full file.

>
> If I change the PUT and GET programs to just go to the root directory
> not a folder within it, it does the same thing except the vmialro.txt
> file on the root directory is NOT blank after running the program but
> nothing is still transferred to the as/400.
>
>  callp     ftp_binary(*on)
>  if        ftp_put(sess: '/home/vmi/vmialro.txt':
>             '/qsys.lib/austeellib.lib/' +
>             'vmifile.file/vmifile.mbr') < 0
>  eval      Msg = ftp_error
>  dsply                   Msg


Ahhhhh..  I see...   You're doing this from the IFS to QSYS on the SAME
AS/400?   The problem is, ftp_put() expects the remote (destination) file
in the first parameter, and the local (source) file as the second parm.

So, the code above is sending from the vmifile.mbr to the vmialro.txt,
which wipes out vmialro.txt.  The fix should just be to reverse the order
of the pathnames.  i.e.:

   if        ftp_put(sess: '/qsys.lib/austeellib.lib/' +
              'vmifile.file/vmifile.mbr':
              '/home/vmi/vmialro.txt') < 0

Although that should work, I find myself wondering why you're using FTP
to transfer it from one place to another place on the same machine?
Why not just download it to the QSYS location in the first place?

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