🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17970

URGENT: Getting File Size

#17970
From: Jason Terando
Date: Wed, 09 Sep 1998 00:00
27 lines
1293 bytes
I have an applet polling a file, with the intention of getting new data
when the file grows.  I have been unable to get a consistent file size
using the Java Plug-In, Netscape 4.05 (1.1 update) or IE 4.01. -- so I
have a feeling I am not doing something right with the language.  Here's
what I'm doing:

    BufferedInputStream  inpuytStream;
    long bytesAvailable;

        try {
            inputStream = new BufferedInputStream( new
URL(Source).openStream());  // Source is a string specifiying where my
file is
            bytesAvailable = inputStream.available();
          }
        catch (Exception e)
        {
            return;
        }


My file is 6993, available() returns anywhere between 4597 and over 9000
bytes.

HOW DO I GET A FILE'S SIZE?

Thanks!
Technical Details
Message-ID: <35F6ECF5.B923ADE3@eatme.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,457e428e79cd68b2,start
X-Google-Attributes: gidf74b3,public
From: Jason Terando <screw_spammers@eatme.com>
Subject: URGENT:  Getting File Size
Date: 1998/09/09
Message-ID: <35F6ECF5.B923ADE3@eatme.com>
X-Deja-AN: 389511937
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language