The netrc structures provides procedures to parse authentication information contained in /.netrc.
On Unix systems the netrc file may contain information allowing automatic login to remote hosts. The format of the file is defined in the ftp(1) manual page. Example lines are
machine ondine.cict.fr login marsden password secret default login anonymous password user@site
The netrc file should be protected by appropriate permissions, and (like /usr/bin/ftp) this library will refuse to read the file if it is badly protected. (unlike ftp this library will always refuse to read the file -- -ftp refuses it only if the password is given for a non-default account). Appropriate permissions are set if only the user has permissions on the file.
This procedure looks for the entry related to given host in the user's netrc file. The host is specified in host. Accept-default? specifies whether netrc-machine-entry should fall back to the default entry if there is no macht for host in the netrc file. If specified, file-name specifies an alternate file name for the netrc data. It defaults to .netrc in the current user's home directory.Netrc-machine-entry returns a netrc entry (see below) if it was able to find the requested information; if not, it returns #f.
If the netrc file had inappropriate permissions, netrc-machine-entry raises an error.
Netrc-entry? is the predicate for netrc entries. The other procedures are selectors for netrc entries as returned by netrc-machine-entry. They return #f if the netrc file didn't contain a binding for the corresponding field.
This returns the macro definitions from the netrc files, represented as an alist mapping macro names -- represented as strings -- to definitions -- represented as lists of strings.