I'm creating a file like so:

                        FileOutputStream fos = openFileOutput("movie.mpg", 0);

                        int bytes_read = 0;
                        int total_bytes_read = 0;
                        do {
                                bytes_read = is.read(b);
                                if (bytes_read > 0) {
                                        fos.write(b, 0, bytes_read);
                                        total_bytes_read+=bytes_read;
                                }
                        } while (bytes_read != -1);

                        fos.close();

I tried to get the file size using this:

                        File file = new File("movie.mpg");

                        // Get the number of bytes in the file
                        long length = file.length();

It just returns 0.  Anyone know how to get the size of the file?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to