This will allow the checks to be changed for different operating systems.
Issue #260 is related to this, but this does not change any current behaviour.
Create separate function to convert user ID / group ID of a user to integer.
Windows is a stub, since this doesn't work on Windows (uid/gid is not a number).
The syscall.Stat_t doesn't exist on Windows, so it is replaced by an interface,
which Windows can fill out, and field access is replaced by function calls.
Common Unix functionality is put into "node_unix.go", so there is less boilerplate.
Symlinks are skipped on Windows, since they require admin privileges.
We ignore parser errors on Uid/Gid, since they are not numbers on Windows.
UID/GID is usually 'root' on Linux, so I am not sure if 0/0 is a good idea.
Maybe if the type of the fields were changed from uint32 to int, we could set it
to -1 to indicate "no value".
The method of determining if a repository exists doesn't work on Windows, since
the "url.Scheme" will contain the drive letter - "c" in "c:\backup",
so as a first step we check if the URL can be opened as a file,
and if so, we assume it is a 'local' type repository.
Files must be closed on Windows before they can be deleted.
Therefore we keep track of all open files, and closes them before
we delete them.
Also we don't set finished blobs to read-only on Windows, since
that prevents us from deleting them.
Since Windows cannot to a SIGHUP test to check if a process is live,
the test will fail because the lock isn't detected as stale if a process with
that ID exists. Process IDs are re-used agressively on Windows, so add 500000 makes
the test extremely unlikely (if not impossible) to fail.
On Windows, User ID/Group ID is not a number, so we ignore any parsing error
that may come from attempting to convert it to an integer. It will simply be '0'.
Don't defer the process Release until we have checked the error.
Skip the SIGHUP connection attempt on Windows. If the process exists, we assume it is running.