[Zope] get size of file in localfs
Michael Bleijerveld
michael@bleijerveld.nl
Thu, 17 Jul 2003 14:35:02 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0032_01C34C70.9B9FDFE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I am using the following statements in order the filesize.
file =3D container.REQUEST.form['FILE']
filesize =3D len(file.read())
When getting the size of large files it takes a long time to calculate.
Is there another (fast) way to get the filesize in a python script ?
Regards,
Michael
------=_NextPart_000_0032_01C34C70.9B9FDFE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I am using the following statements in =
order the=20
filesize.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>file =3D =
container.REQUEST.form['FILE']<BR>filesize =3D=20
len(file.read())<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When getting the size of large files it =
takes a=20
long time to calculate.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Is there another (fast) way to get the =
filesize in=20
a python script ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Michael</FONT></DIV></BODY></HTML>
------=_NextPart_000_0032_01C34C70.9B9FDFE0--