filesize

java get file size efficiently

While googling, I see that using java.io.File.length() can be slow. FileChannel has a size() method that is available as well. Is there an efficient way in java to get the file size? ...

C#: File-size format provider

Is there any easy way to create a class that uses IFormatProvider that writes out a user-friendly file-size? public static string GetFileSizeString(string filePath) { FileInfo info = new FileInfo(@"c:\windows\notepad.exe"); long size = info.Length; string sizeString = size.ToString(FileSizeFormatProvider); // This is where t...

SSRS 2005 help - need to get file size from within TSQL (path specified in column). Anyone?

I need to get the Folder size and display the info on a report (SSRS). I need to do this for a number of Databases (loop!). These DB's are websites' backends. Has anyone done this before? Can you please point me to some samples or right direction? Does xp_filesize and the like the right solution? Help! ...

why shrink a sqlserver 2005 database?

What are the advantages and disadvantages of shrinking a database? Are there any performance implications? ...

Added code, swf size got ... smaller?

... I'm working on a couple of theories, but I'm interested to hear other opinions. This has been verified on three different machines, two windows the other linux. The compiler used is flexbuild (Presumably mxmlc) and ant with mxmlc. We added code to a small stand-alone single .as file project and the compiled swf file size went down ...

Total download size of *initial* page of major websites

I'm quite surprised how large some major websites homepages are. This is the total amount downloaded just when opening the homepage. cnn.com - 845kb microsoft.com - 470kb yahoo.com - 235kb gillette.com (flash) - 3.8Mb abc.com - 3.4Mb nbc.com - 1.4Mb youtube.com - 530kb Anyone care to add to the list? I'm just trying to justify the siz...

How to use size of file inside Ant target

I'm currently in the process of replacing my homebrewn build script by an Ant build script. Now I need to replace various tokens by the size of a specific file. I know how to get the size in bytes via the <length> task and store in in a property, but I need the size in kilobytes and megabytes too. How can I access the file size in othe...

Is there an upper limit on .txt file size?

As a Christmas gift I have written a small program in Java to calculate primes. My intention was to leave it on all night, calculating the next prime and writing it to a .txt file. In the morning I would kill the program and take the .txt file to my friend for Christmas. Is there anything I should be worried about? Bear in mind that thi...

Database size estimation tool

Is there a tool for estimating the size of a database? I am looking for such a tool, which I can input the estimated tables, row size, data types, indexes and other variables to give me a clue about the size of a yet-non-existing database. I know MS Sql Server Books Online has a good documentation on how to estimate but I don't want t...

Computing progress (bar) using GZipStream

I'm reading a .gz file from some slow source (like FTP Server) and am processing the received data right away. Looks something like this: FtpWebResponse response = ftpclientRequest.GetResponse() as FtpWebResponse; using (Stream ftpStream = response.GetResponseStream()) using (GZipStream unzipped = new GZipStream(ftpStream, CompressionMo...

How do I get the size of a file in megabytes using Perl?

I want to get the size of a file on disk in megabytes. Using the -s operator gives me the size in bytes, but I'm going to assume that then diving this by a magic number is a bad idea: my $size_in_mb = (-s $fh) / (1024 * 1024); Should I just use a read-only variable to define 1024 or is there a programmatic way to obtain the size of a...

Is my index page too large?

I'm developing a site right now that I've been working on for more than a year. Today, I am about one week from launching so I started going over things that I've not gone over during the last year - including loading-times. I've not noticed any loading-issues, but I still wanted to look. The following represents my index page: Docume...

Any way to analyze the size of a SWF built in Flex?

I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going. I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested ...

How to retrieve the size of a file before uploading it?

I have an file input tag in my web app. I'd like to check that the file isn't too big before sending it to the server. Of course, I still have validation server side. Is there any way to do this with JavaScript? It must work in IE7+ and FF3+. Thank you. EDIT: somefileinputobject.files[0].filesize works in FF, but not IE. ...

How to create a file of size more than 2GB in Linux/Unix?

I have this home work where I have to transfer a very big file from one source to multiple machines using bittorrent kinda of algorithm. Initially I am cutting the files in to chunks and I transfer chunks to all the targets. Targets have the intelligence to share the chunks they have with other targets. It works fine. I wanted to transfe...

Optimize ABCpdf file size

We've got a web system that generates dynamic pdf files with ABCpdf. While it works... okay, the file sizes are a little large. For example, this morning as a test I generated a 140+ page file with lots of little graphics (actually, the same six little images repeated over and over.) The total file size was 12 megs and change. Taking...

Any suggestions for shrinking a PDF file?

We've got a .net 2.0 web system that dynamically builds pdf files. Some of these files can get pretty large - 12MB+. While processing time isn't a factor, really, the size of the files to be downloaded is in some cases. For the moment, let's assume that our B-grade pdf library is already making the smallest files that it knows how. ...

How to get max allowed filesize in .Net?

Hello there, Does anyone know how to (natively) get the max allowed file size for a given drive/folder/directory? As in for Fat16 it is ~2gb, Fat32 it was 4gb as far as I remember and for the newer NTFS versions it is something way beyond that.. let alone Mono and the underlying OSes. Is there anything I can read out / retrieve that mi...

How to reduce swf filesize flex

how can i reduce the file size of my flex application. its around 900kb . ...

Ways to reduce MS SQL database backup file sizes

This question might make one smile, really, HDD space is as cheap as dirt today. But nevertheless, with extremely slow internet connections (which is still the case in the major part of the world) transferring backups from different branches might be real pain in the back. So, do you have any ideas on how to decrease database file size ...