[Tutor] Re: FTP Question

Derrick 'dman' Hudson dman@dman.ddts.net
Thu, 13 Jun 2002 20:57:47 -0500


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 13, 2002 at 04:50:08PM -0700, Sheila King wrote:
| On Thu, 13 Jun 2002 16:41:29 -0700 (PDT), Chad Crabtree wrote:
| > #after connecting and logging in ftp.storbinary('STOR
| > file',open('file','rb))
| >
| >
| > and this method was successful which supprised me however I'm
| > wondering if this file is now just floating around in memory,
| > because I couldn't figure out how to close it.  Hmmmm
|=20
| The file closes itself.
|=20
| Since you did not assign any "identifier" or variable name to=20
| reference the object, it will close as soon as you are done working=20
| with it.

This assumes that no dangling references exist.  It also assumes there
are no bugs in the interpreter that could crash it before that
happens.  I think it is better practice to assign it to a handle and
explicitly close() it when you are done.

-D

--=20

One OS to rule them all, one OS to find them,
One OS to bring them all and in the darkness bind them,
In the Land of Redmond, where the Shadows lie.
=20
http://dman.ddts.net/~dman/


--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj0JTZsACgkQO8l8XBKTpRSngACfVKfQ8CeVrOcMiReNTX8OHkZK
/2cAn1EMZZ+7B0JUdav+QegXyZI+1NP8
=vr2N
-----END PGP SIGNATURE-----

--sm4nu43k4a2Rpi4c--