Unix utility routines.

The UnixUtil unit contains some of the routines that were present in the old Linux unit, but which do not really belong in the unix or baseunix units.

Most of the functions described here have cross-platform counterparts in the SysUtils unit. It is therefore recommended to use that unit.

Seconds west of GMT Command-line string type. Filename full path string type. Filename directory part string type. Filename name part string type. Filename extension part string type. Extract directory part from filename

Returns the directory part of Path. The directory is the part of Path before the last slash, or empty if there is no slash. The last character of the result is not a slash, unless the directory is the root directory.

None.
Split string in list of null-terminated strings

StringToPPChar splits the string S in words, replacing any whitespace with zero characters. It returns a pointer to an array of pchars that point to the first letters of the words in S. This array is terminated by a Nil pointer.

The function does not add a zero character to the end of the string unless it ends on whitespace.

The function reserves memory on the heap to store the array of PChar; The caller is responsible for freeing this memory.

This function can be called to create arguments for the various Exec calls.

None.
Concert an array of string to an array of null-terminated strings

ArrayStringToPPchar creates an array of null-terminated strings that point to strings which are the same as the strings in the array S. The function returns a pointer to this array. The array and the strings it contains must be disposed of after being used, because it they are allocated on the heap.

The ReserveEntries parameter tells ArrayStringToPPchar to allocate room at the end of the array for another ReserveEntries entries.

If not enough memory is available, an error may occur.
Return basename of a file

Returns the filename part of Path, stripping off Suf if it exists. The filename part is the whole name if Path contains no slash, or the part of Path after the last slash. The last character of the result is not a slash, unless the directory is the root directory.

None.
Check whether filename matches wildcard specification

FNMatch returns True if the filename in Name matches the wildcard pattern in Pattern, False otherwise.

Pattern can contain the wildcards * (match zero or more arbitrary characters) or ? (match a single character).

None.
Return file selector GetFS returns the file selector that the kernel provided for your file. In principle you don' need this file selector. Only for some calls it is needed, such as the call or so. In case the file was not opened, then -1 is returned. Split filename into path, name and extension FSplit splits a full file name into 3 parts : A Path, a Name and an extension (in ext). The extension is taken to be all letters after the last dot (.). None. Convert local time to epoch (unix) time Converts the Local time to epoch time (=Number of seconds since 00:00:00 , January 1, 1970 ). None Convert epoch time to local time

Converts the epoch time (=Number of seconds since 00:00:00 , January 1, 1970, corrected for your time zone ) to local date and time.

This function takes into account the timzeone settings of your system.

None
Converts a julian date to a gregorian date JulianToGregorian takes a julian day and converts it to a gregorian date. (Start of the Julian Date count is from 0 at 12 noon 1 JAN -4712 (4713 BC),) None. Converts a gregorian date to a julian date GregorianToJulian takes a gregorian date and converts it to a Julian day. None.