Formatting File Size Snippets


A custom Delphi function, FormatByteSize, converts a byte value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, or gigabytes, depending on the size.

PHP code for current Month/Day/Date with HTML colors & formatting.

This is a PHP Class that calculates the size, number of files & folders of a specific directory.

26 April, 2015   

Recursively determines the size of a directory

01 August, 2013   

Example Java code for Fast File Copy using NIO

25 October, 2012   

Java code example to fast file copy using NIO

08 November, 2012   

Pass the number of bytes and it automatically returns it in b,kb,mb,gb,tb or pb

16 April, 2011   

There are times when you need to split a large file into several smaller ones (for whatever the purpose is). The following two methods use Delphi TStream objects to break a file into several files with predefined size; and to merge those files back to the original.

06 August, 2011   

The stuff inside the /* */ marks are CSS comments. This allows you to enter notes into CSS that will not be interpreted. In this case, this comment lets someone reading the CSS file know that that particular line of CSS was intended to allow for using ems to set font size later in the CSS in a more intuitive base 10 way.

CSS code example how to custom File Input Styling in WebKit/Blink

This MATLAB code snippet reads in a file stored in the current directory and stores specified lines from the file in a new cell array for manipulation in MATLAB.

30 August, 2011   

Calculates the total size of a MySQL database in KB/MB or GB...

09 November, 2017   

Copies Source file to Dest file, preserving modification date. Required units: Classes, SysUtils.

14 February, 2012   

Use this to size an array for your values

18 September, 2013   

PHP example for listing directory contents

An example for Scripted Helper object plugin

By default, Delphi gets its date/time, currency and numeric format from Control Panel's International settings. We can set the constants defined in Delphi, like DecimalSeparator, ShortDateFormat and others like in the code below. To a complete list of these variables, look at Currency and date/time formatting variables in Delphi Help.

19 January, 2012   

CSS code example how to Set the size of the font

13 April, 2011   

Reading a file to a string couldn't be easier than using the file_get_contents() function. Simple pass the name of the file (with path) and optional parameters

16 January, 2011   

One of the most common mistakes I see beginners and intermediates fall victim to when it comes to CSS is not removing the default browser styling. This leads to inconsistencies in the appearance of your design across browsers, and ultimately leaves a lot of designers blaming the browser. It is a misplaced blame, of course. Before you do anything...