NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_baseunit(n) 4.99.30 naviserver "NaviServer Built-in Commands"

Name

ns_baseunit - Check whether the provided byte-array contains a valid UTF-8 byte sequence

Table Of Contents

Synopsis

Description

COMMANDS

ns_baseunit ?-size size? ?-time time?

Convert from memory units or from time units to its base value using the NaviServer internal converters, which are used the same way for various commands. The base unit for a memory size is a byte, for a time value a second). This command os necessary to provide Tcl-level commands calculating with these units to support uniform interfaces (e.g. calculating cache partition sizes base on values such as 2MB).

Either -size size or -time time has to be specified. Valid time units are μs, ms, s, m, h, d, w, y. Valid size units are kB, MB, GB, KiB, MiB, GiB.

EXAMPLES

 % ns_baseunit -size 10KB
 10240
 
 ns_baseunit -time 2.5h
 9000

Keywords

conversion, global built-in, size, time, unit