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? ...
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? ...
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...
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! ...
What are the advantages and disadvantages of shrinking a database? Are there any performance implications? ...
... 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 ...
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...
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...
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...
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...
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...
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...
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...
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 ...
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. ...
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...
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...
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. ...
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 can i reduce the file size of my flex application. its around 900kb . ...
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 ...