Module util

Utility functions.

Introduced in: 15 Nov 2002 by Magnus Ahltorp <ahltorp@nada.kth.se>

Authors: Magnus Ahltorp (ahltorp@nada.kth.se).

Description

Utility functions.

Function Index

casecompare/2 return true if Str1 and Str2 are either 'none' or the same string (ignore case).
casegrep/2 determine if Str is a member of StrList.
concat/2 create a single string from the Strings entries, each entry ends with the Separator.
isnumeric/1 Determine if Number is a string containing only numbers.
join/2 Create a single string from the Strings entries.
regexp_rewrite/2 Do regexp substitution.
remove_v6_brackets/1 If In is "[IPv6Address]" then return "IPv6Address".
safe_is_process_alive/1 determine if the process Process is running.
safe_signal/3 Check if a process is alive before sending it a signal.
sec_to_date/1 Takes a Seconds value (for example the result of timestamp/0) and returns a nicely formatted date-time string ("yyyy-mm-dd hh:mm:ss").
timestamp/0 Number of seconds elapsed since start point used by now().

Function Details

casecompare/2

casecompare(String::Str1, String2::Str2) -> true | false

return true if Str1 and Str2 are either 'none' or the same string (ignore case)

casegrep/2

casegrep(String1::Str, Rest::StrList) -> true | false

determine if Str is a member of StrList

concat/2

concat(B::Strings, Separator) -> list()

create a single string from the Strings entries, each entry ends with the Separator.

isnumeric/1

isnumeric(Number) -> true | false

Determine if Number is a string containing only numbers. Length of Number must be >= 1. Note : Using the BIF list_to_integer() is probably cheaper.

join/2

join(T::Strings, Separator) -> string()

Create a single string from the Strings entries. Separator is placed between all entries (but not after the last one).

regexp_rewrite/2

regexp_rewrite(Input, Rest::RegexpList) -> string() | nomatch

Do regexp substitution. If Input is "foobar" and the regexp tuple is {"foo(.+)", "\\1@example.com"} this function will return "bar@example.com".

remove_v6_brackets/1

remove_v6_brackets(Rest::In) -> In | V6addr

If In is "[IPv6Address]" then return "IPv6Address". Otherwise, return whatever In was.

safe_is_process_alive/1

safe_is_process_alive(Pid::Process) -> {Alive, ProcessPid}

determine if the process Process is running

safe_signal/3

safe_signal(LogTag, PidIn, Message) -> ok | error

Check if a process is alive before sending it a signal.

sec_to_date/1

sec_to_date(Seconds) -> string()

Takes a Seconds value (for example the result of timestamp/0) and returns a nicely formatted date-time string ("yyyy-mm-dd hh:mm:ss").

timestamp/0

timestamp() -> integer()

Number of seconds elapsed since start point used by now()


Generated by EDoc, Oct 17 2007, 16:48:27.