filesize

H.264 file size for 1 hr of HD video [closed]

痞子三分冷 提交于 2019-11-27 16:12:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm looking for an order of magnitude estimate for expected on-disk file size for 1 hour of H.264 encoded HD video transcoded from HDV (HD on a MiniDV tape). I want to archive approximately 100 hours of such content and want to figure out whether I'm looking at a big hard drive, a multi-drive unit like a Drobo,

PHP filesize reporting old size

旧巷老猫 提交于 2019-11-27 14:37:57
The following code is part of a PHP web-service I've written. It takes some uploaded Base64 data, decodes it, and appends it to a file. This all works fine. The problem is that when I read the file size after the append operation I get the size the file was before the append operation. $fileOut = fopen($filepath.$filename, "ab") fwrite($fileOut, base64_decode($data)); fflush($fileOut); fclose($fileOut); $newSize = filesize($filepath.$filename); // gives old file size What am I doing wrong? System is: PHP 5.2.14 Apache 2.2.16 Linux kernel 2.6.18 On Linux based systems, data fetched by filesize(

Get size of file requested via ajax

和自甴很熟 提交于 2019-11-27 13:41:36
Here's what I'm hoping to do: I want to send an ajax request to a file (preferably with jQuery), and once the file has been loaded, determine the size of the requested file. After a bit of googling, it's clear that I don't even have a good idea of the right question to ask to figure this out. Any help would be greatly appreciated. You could make a HTTP HEAD request, and get a file size approximate by reading the Content-Length HTTP Header. This kind of request is used to obtain meta-information about the URL implied by the request, without transferring any content of it in the response. var

Pretty file size in Ruby?

安稳与你 提交于 2019-11-27 12:16:38
问题 I'm trying to make a method that converts an integer that represents bytes to a string with a 'prettied up' format. Here's my half-working attempt: class Integer def to_filesize { 'B' => 1024, 'KB' => 1024 * 1024, 'MB' => 1024 * 1024 * 1024, 'GB' => 1024 * 1024 * 1024 * 1024, 'TB' => 1024 * 1024 * 1024 * 1024 * 1024 }.each_pair { |e, s| return "#{s / self}#{e}" if self < s } end end What am I doing wrong? 回答1: How about the Filesize gem ? It seems to be able to convert from bytes (and other

PHP include(): File size & performance

断了今生、忘了曾经 提交于 2019-11-27 11:54:27
An inexperienced PHP question: I've got a PHP script file that I need to include on different pages lots of times in lots of places. I have the option of either breaking the included file down into several smaller files and include these on a as-needed basis... OR ... I could just keep it all together in a single PHP file. I'm wondering if there's any performance impact of using a larger vs. smaller file for include() in this context? For example, is there any performance difference between a 200KB file and a 20KB file? Thank you. There will be a difference, between a 200KB and a 20KB file...

Finding file's size

雨燕双飞 提交于 2019-11-27 11:25:39
In my iPhone app I am using the following code to find a file's size. Even though the file exists, I am seeing zero for the size. Can anyone help me? Thanks in advance. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *URL = [documentsDirectory stringByAppendingPathComponent:@"XML/Extras/Approval.xml"]; NSLog(@"URL:%@",URL); NSError *attributesError = nil; NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:URL error:&attributesError]; int fileSize

File-size format provider

最后都变了- 提交于 2019-11-27 06:17:51
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 the class does its magic... } It should result in strings formatted something like " 2,5 MB ", " 3,9 GB ", " 670 bytes " and so on. I use this one, I get it from the web public class FileSizeFormatProvider : IFormatProvider, ICustomFormatter { public object GetFormat(Type

How to prevent Warning: POST Content-Length and memory size

删除回忆录丶 提交于 2019-11-27 06:01:26
问题 Currently when user uploads a photo the page says "Warning: POST Content-Length of XXX bytes exceeds the limit of 21000000 bytes in Unknown on line 0". I know what that means and I am NOT looking for the solultions like the increasing the max_upload values or even memory_size_limit... Because users may and users will upload terabytes of nonsense even if you explicitly tell them only max 20MB files and only images are allowed. I am looking for a solution on: How to prevent this warning(s) to

HDFS block size Vs actual file size

馋奶兔 提交于 2019-11-27 05:26:08
问题 I know that HDFS stores data using the regular linux file system in the data nodes. My HDFS block size is 128 MB . Lets say that I have 10 GB of disk space in my hadoop cluster that means, HDFS initially has 80 blocks as available storage. If I create a small file of say 12.8 MB , #available HDFS blocks will become 79. What happens if I create another small file of 12.8 MB ? Will the #availbale blocks stay at 79 or will it come down to 78? In the former case, HDFS basically recalculates the

Better way to convert file sizes in Python

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 05:07:06
问题 I am using a library that reads a file and returns its size in bytes. This file size is then displayed to the end user; to make it easier for them to understand it, I am explicitly converting the file size to MB by dividing it by 1024.0 * 1024.0 . Of course this works, but I am wondering is there a better way to do this in Python? By better, I mean perhaps a stdlib function that can manipulate sizes according to the type I want. Like if I specify MB , it automatically divides it by 1024.0 *