tcl-quill 0.3.0: Quill Project Automation System for Tcl/Tk

os(n): OS Independence -- quill(n)

SYNOPSIS
DESCRIPTION
COMMANDS
AUTHOR
SEE ALSO

SYNOPSIS

package require quill 0.3.0
namespace import ::quill::*
os flavor
os flavors
os name
os exefile base
os pathequal p1 p2
os pathfind progname
os username
os setexecutable filename

DESCRIPTION

os(n) is Quill's operating system independence layer. All operations that will work differently on different operating systems will be handled here.

COMMANDS

os(n) defines the following commands:

os flavor
This command returns the "flavor" of the operating system, from Quill's point of view. Quill is intended to run on Linux, Mac OSX, and Windows; only rarely is more information required. Thus, this routine returns linux, osx, or windows. Modules require more detailed information (i.e., the platform architecture) should use the standard platform(n) package.

os flavors
Returns a list of the valid OS flavors: linux, osx, and windows.

os name
Returns a prettier version of the os flavor for output to the user.

os exefile base
Given a base executable name, e.g., "myapp", this routine appends ".exe" on Windows and leaves the name alone on other platforms, returning the result.

os pathequal p1 p2
Compares two paths for equality, taking into account that either or both might be symlinks. Returns 1 immediately if the two paths are identical. Otherwise, it follows up to one symlink for each path, and retries, return 1 on equality and 0 otherwise.

os pathfind progname
Given the name of a program, e.g., "tclsh" or "tclsh.exe" as appropriate for the platform, this routine attempts to find it on the PATH.

On Windows, the routine assumes the path separator is ";", but also tries ":" in case the user is executing Quill from a bash command line (e.g., from the MinGW environment).

The routine returns the empty string if it cannot locate the program.

os username
Returns the current user's login name, if possible, and "" otherwise. The user name is determined by querying a series of environment variables ("USER", "USERNAME", "LOGNAME").

os setexecutable filename
Sets the executable flag for the named file using Tcl's file attributes command.

This is a no-op on Windows, where file attributes is not available.

AUTHOR

Will Duquette

SEE ALSO

quill(n).
Generated from os.manpage on Sat Nov 08 09:29:59 PST 2014