Board index » delphi » Problem in FTP of Indy9

Problem in FTP of Indy9

Hi all,

I got a problem while use IdFTP component to get binary file from a SUN
solrias 2.5 server. I found if the file contains char '$0A', which means
'new line descriptor', the IDFTP will automatically add char '$0D' before
every '$0A', even I have set the tranferType to be 'ftBinary'.

Does anyone here know about this issue?

Thanks in advance.

Peer

 

Re:Problem in FTP of Indy9


Quote
Peer Liu <peer_...@hotmail.com> wrote in message

news:3ea02e71@newsgroups.borland.com...

Quote
> Hi all,

> I got a problem while use IdFTP component to get binary file from a
SUN
> solrias 2.5 server.

I had problems with Solaris too.  The size of the remote file always
came back as 0.  My FTP app worked fine with HP & other FTP servers,
but not SUN.

Some Team-B person wanted a directory listing to as to possibly
change the Indy code to parse the Solaris listing properly, but I
could not help as I had alredy left the coy. using the SUNs.

On the other hand, if I ignored the returned file size & transferred
the file anyway, it came through OK - no extra CRs added.

Wierd.

Rgds,
Martin

Re:Problem in FTP of Indy9


On Mon, 21 Apr 2003 16:35:57 +0100, "Martin James"

Quote
<mjames_fal...@dial.pipex.com> wrote:

>Peer Liu <peer_...@hotmail.com> wrote in message
>news:3ea02e71@newsgroups.borland.com...
>> Hi all,

>> I got a problem while use IdFTP component to get binary file from a
>SUN
>> solrias 2.5 server.

>I had problems with Solaris too.  The size of the remote file always
>came back as 0.  My FTP app worked fine with HP & other FTP servers,
>but not SUN.

I would like to see the listing to see what can be done in Indy 10.

I always thaught Sun Soloris was simply a Unix operating system and
simply used the output of /bin/ls (that seems to be a de facto
standard).

There has been a backport of the Unix parser in Indy 10 to Indy in our
VCS already and that is available for Indy 9.  That might help matters
better.

J. Peter Mugaas - Chairperson, Distribution Team, Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you.  Otherwise, do not contact me.

Re:Problem in FTP of Indy9


"Peer Liu" <peer_...@hotmail.com> D????D???
:3ea02...@newsgroups.borland.com...

Quote
> Hi all,

> I got a problem while use IdFTP component to get binary file from a SUN
> solrias 2.5 server. I found if the file contains char '$0A', which means
> 'new line descriptor', the IDFTP will automatically add char '$0D' before
> every '$0A', even I have set the tranferType to be 'ftBinary'.

> Does anyone here know about this issue?

> Thanks in advance.

> Peer

Is it a problem of Indy?
I think so.
For example, if you get a text file from Solaris system, and if you set the
transfer mode of TIdFTP to be ftBinary, you will also find the Indy will
automatiaclly add char '$0D' before every char '$0A', because text file with
UNIX style has only char '$0A' at the end of every line. I think this
feature is used for format conversion between UNIX and Windows.

Does anybody know how to disable it?

Re:Problem in FTP of Indy9


"Peer Lu" <qch1...@email.mot.com> wrote in
news:3ea4e2bd@newsgroups.borland.com:

Quote
> Is it a problem of Indy?
> I think so.

No, its not. In Binary Indy does not do any altering of the output. NEither
does it in text mode.

Its up to the server to make the changes.

Quote
> For example, if you get a text file from Solaris system, and if you set
> the transfer mode of TIdFTP to be ftBinary, you will also find the Indy
> will automatiaclly add char '$0D' before every char '$0A', because text
> file with UNIX style has only char '$0A' at the end of every line. I
> think this feature is used for format conversion between UNIX and
> Windows.

Indy does not modify the file transfers.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

   Want more Indy stuff? Try the Atozed Indy Portal at
        http://www.atozedsoftware.com/
    * More Free Demos
    * Free Articles
    * Extra Support

ELKNews - Get your free copy at http://www.atozedsoftware.com

Re:Problem in FTP of Indy9


there was an issue in indy 9, when loging in manually ( with .login )

are you loging in manually?

Bas

Quote
"Peer Liu" <peer_...@hotmail.com> wrote in message

news:3ea02e71@newsgroups.borland.com...
| Hi all,
|
| I got a problem while use IdFTP component to get binary file from a SUN
| solrias 2.5 server. I found if the file contains char '$0A', which means
| 'new line descriptor', the IDFTP will automatically add char '$0D' before
| every '$0A', even I have set the tranferType to be 'ftBinary'.
|
| Does anyone here know about this issue?
|
| Thanks in advance.
|
| Peer
|
|

Re:Problem in FTP of Indy9


No, I log server by providing username and password to Indy.

"Bas Gooijen" <bas_gooi...@yahoo.com> D????D???
:3ea80...@newsgroups.borland.com...

Quote
> there was an issue in indy 9, when loging in manually ( with .login )

> are you loging in manually?

> Bas

> "Peer Liu" <peer_...@hotmail.com> wrote in message
> news:3ea02e71@newsgroups.borland.com...
> | Hi all,
> |
> | I got a problem while use IdFTP component to get binary file from a SUN
> | solrias 2.5 server. I found if the file contains char '$0A', which means
> | 'new line descriptor', the IDFTP will automatically add char '$0D'
before
> | every '$0A', even I have set the tranferType to be 'ftBinary'.
> |
> | Does anyone here know about this issue?
> |
> | Thanks in advance.
> |
> | Peer
> |
> |

Re:Problem in FTP of Indy9


Bas Gooijen,

Sorry, I first connect to server without login, then call .login to
authenticate, Would you pls tell me why?
Thanks.
"Peer Liu" <peer_...@hotmail.com> D????D???
:3ea93...@newsgroups.borland.com...

Quote
> No, I log server by providing username and password to Indy.

> "Bas Gooijen" <bas_gooi...@yahoo.com> D????D???
> :3ea80...@newsgroups.borland.com...
> > there was an issue in indy 9, when loging in manually ( with .login )

> > are you loging in manually?

> > Bas

> > "Peer Liu" <peer_...@hotmail.com> wrote in message
> > news:3ea02e71@newsgroups.borland.com...
> > | Hi all,
> > |
> > | I got a problem while use IdFTP component to get binary file from a
SUN
> > | solrias 2.5 server. I found if the file contains char '$0A', which
means
> > | 'new line descriptor', the IDFTP will automatically add char '$0D'
> before
> > | every '$0A', even I have set the tranferType to be 'ftBinary'.
> > |
> > | Does anyone here know about this issue?
> > |
> > | Thanks in advance.
> > |
> > | Peer
> > |
> > |

Re:Problem in FTP of Indy9


You mean it's the sever (SUN OS) that make these changes, but I tried to get
same file by using windows ftp command, it's fine, no any change was made.

And I use TIDTelnet component in my program to get a text file from same
server (something like: execute 'cat' command in SUN server, then echo all
output to socket), I also find same problem that Indy add char '$0d' before
every char '$0a'.

For a text file, it's acceptable to add a control char like '$0d', but not
for a binary file.

Hope more comments.
Thanks.

Peer Liu

"Chad Z. Hower aka Kudzu" <c...@hower.org> D????D???
:Xns9365634412FE1c...@127.0.0.1...

Quote
> "Peer Lu" <qch1...@email.mot.com> wrote in
> news:3ea4e2bd@newsgroups.borland.com:
> > Is it a problem of Indy?
> > I think so.

> No, its not. In Binary Indy does not do any altering of the output.
NEither
> does it in text mode.

> Its up to the server to make the changes.

> > For example, if you get a text file from Solaris system, and if you set
> > the transfer mode of TIdFTP to be ftBinary, you will also find the Indy
> > will automatiaclly add char '$0D' before every char '$0A', because text
> > file with UNIX style has only char '$0A' at the end of every line. I
> > think this feature is used for format conversion between UNIX and
> > Windows.

> Indy does not modify the file transfers.

> --
> Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
>       "Programming is an art form that fights back"

>    Want more Indy stuff? Try the Atozed Indy Portal at
>         http://www.atozedsoftware.com/
>     * More Free Demos
>     * Free Articles
>     * Extra Support

> ELKNews - Get your free copy at http://www.atozedsoftware.com

Re:Problem in FTP of Indy9


"Peer Liu" <peer_...@hotmail.com> wrote in
news:3ea93ff1@newsgroups.borland.com:

Quote
> You mean it's the sever (SUN OS) that make these changes, but I tried to

Yes.

Quote
> get same file by using windows ftp command, it's fine, no any change was
> made.

It depends on text or binary mode - and its up to the server if it does
anything.

Quote
> And I use TIDTelnet component in my program to get a text file from same
> server (something like: execute 'cat' command in SUN server, then echo
> all output to socket), I also find same problem that Indy add char '$0d'
> before every char '$0a'.

Are you using Text or binary mode? In Binary indy changes NOTHING. In text it
might format it for Windows - I'd have to look.

Quote
> For a text file, it's acceptable to add a control char like '$0d', but
> not for a binary file.

Indy does not modify binary files - trace the source to see.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

   Want to keep up to date with Indy?

   Join Indy News - it free!

      http://www.atozedsoftware.com/indy/news/

ELKNews - Get your free copy at http://www.atozedsoftware.com

Re:Problem in FTP of Indy9


Because there was a bug when doing that, the bug caused all files to be
transferred in ASCII mode.

the changed file can be found on the vcs or here:
http://wwwi.sitecreations.net/bas/delphi/IdFTP.pas

Bas

Quote
"Peer Liu" <peer_...@hotmail.com> wrote in message

news:3ea93d27@newsgroups.borland.com...
| Bas Gooijen,
|
| Sorry, I first connect to server without login, then call .login to
| authenticate, Would you pls tell me why?
| Thanks.

Re:Problem in FTP of Indy9


Hi, Bas
Thank you very much.
It works fine.

Peer

"Bas Gooijen" <bas_gooi...@yahoo.com> D????D???
:3ea9b...@newsgroups.borland.com...

Quote
> Because there was a bug when doing that, the bug caused all files to be
> transferred in ASCII mode.

> the changed file can be found on the vcs or here:
> http://wwwi.sitecreations.net/bas/delphi/IdFTP.pas

> Bas

> "Peer Liu" <peer_...@hotmail.com> wrote in message
> news:3ea93d27@newsgroups.borland.com...
> | Bas Gooijen,
> |
> | Sorry, I first connect to server without login, then call .login to
> | authenticate, Would you pls tell me why?
> | Thanks.

Other Threads