You are here: Re: ftp_close() vs. ftp_quit() « PHP Programming Language « IT news, forums, messages
Re: ftp_close() vs. ftp_quit()

Posted by Kim Andrι Akerψ on 05/21/07 15:35

Markus wrote:

> purcaholic schrieb:
> >On 21 Mai, 13:34, Markus <derernst@NO#SP#AMgmx.ch> wrote:
> > > Hi
> > >
> > > I encountered that FTP connections seem to remain open on the FTP
> > > server, though my FTP class has a shutdown function that
> > > ftp_quit()s the connection.
> > >
> > > I did not find any info in the manual regarding the differences of
> > > ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even
> > > first close, then quit? Is it possible that ftp_quit() does not
> > > close the connection on the FTP server? Or do I have to look for
> > > something else?
> > >
> > > Thanks for some hints!
> > > Markus
> >
> >
> > Hi,
> >
> > ftp_close() and ftp_quit() do the same job, ftp_quit() is an alias
> > of ftp_close().
>
> Thank you for this info. It is bad news for me, as it does contradict
> my assumptions regarding my actual problem. Anyway both functions
> seem to be wrongly documented in the manual:
>
> void ftp_close ( resource $ftp_stream )
> int ftp_quit ( int $ftp_stream )
>
> As the signatures differ, they do not really seem to be aliases of
> one another. But actually they seem to behave the same, both not
> according to the manual: var_dump(ftp_close($conn_id)) and
> var_dump(ftp_quit($conn_id)) both display bool(true)... I filed a bug
> about this.

Which manual have you been reading? These are the only official manual
entries for ftp_quit() and ftp_close():
http://php.net/ftp_quit
http://php.net/ftp_close

Both should, and they do, return a boolean value (TRUE on success or
FALSE on failure) according to your own tests (and since ftp_quit() is
an alias for ftp_close(), there shouldn't be a difference, either).

> Anyway: Is there a possibility to find out whether a connection has
> been terminated on the FTP server side, too? (I mean, besides asking
> the ISP to give me access to log files.)

There's no way of telling, much like there's no way of telling whether
the connection to a web server was properly closed on the server side
after you've visited a website.

The only way of telling whether a connection has been terminated on the
server side, is to ask the administrator or owner of the server you're
connecting to.

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация