ExFacts v0.1.5 ExFacts.Utils
Contains common logic that is used mostly internally by other modules.
Summary
Functions
Iterates through a list and removes any items that math the argument. If the argument given is not in the specified list it returns the original list
Returns the path to /etc on the filesystem
Returns the path to somefile in /etc on the filesystem
Returns the path to /proc on the filesystem
Returns the path to somefile in /proc on the filesystem
Returns the path to /sys on the filesystem
Returns the path to somefile in /sys on the filesystem
Returns an empty map if the binary itself is empty
Reads in a file at the path provided in the binary using the binread method. This allows the caller to be able to read files that are provided by kernal calls that are not usual files
Types
Functions
Iterates through a list and removes any items that math the argument. If the argument given is not in the specified list it returns the original list.
Examples
iex> ["Some", "items", "are", "here"] |> delete_all("are")
["Some", "items", "here"]
iex> ["Some", "items", "are", "are", "here"] |> delete_all("are")
["Some", "items", "here"]
iex> ["Some", "items", "are", "here"] |> delete_all("foo")
["Some", "items", "are", "here"]
Returns the path to /etc on the filesystem.
Defaults to /etc and is only evaluated at compile time. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/etc
Returns the path to somefile in /etc on the filesystem.
Defaults to /etc/somefile, it can also be overriden at runtime via environment variables. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/etc/somefile
Returns the path to /proc on the filesystem.
Defaults to /proc and is only evaluated at compile time. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/proc
Returns the path to somefile in /proc on the filesystem.
Defaults to /proc/somefile, it can also be overriden at runtime via environment variables. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/proc
Returns the path to /sys on the filesystem.
Defaults to /sys and is only evaluated at compile time. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/sys
Returns the path to somefile in /sys on the filesystem.
Defaults to /sys/somefile, can also be overriden at runtime via environment variables. Note: When MIX_ENV=test it defaults to __DIR <> /test/files/etc
normalize_with_underscore(map) :: map
normalize_with_underscore(tuple) :: tuple
normalize_with_underscore(binary) :: map
Returns an empty map if the binary itself is empty.
Reads in a file at the path provided in the binary using the binread method. This allows the caller to be able to read files that are provided by kernal calls that are not usual files.
If sane: true
is passed then read in data is also split by new line characters and
returned as a list of each line.