# GetSystemEnv

v0.3.0 (2008-06-09)

An AviSynth plug-in to retrieve information from the system.

by James D. Lin (stickboy)

## Overview

`GetSystemEnv` retrieves the value of an environment variable.

`GetWorkingDir` retrieves the current working directory.

`SetWorkingDir` sets the current working directory.

`GetFileInfo` retrieves information about a specified file.

## Syntax

    GetSystemEnv(string varName)
    GetWorkingDir()
    SetWorkingDir(string path)
    GetFileInfo(string filename, string propertyName)

## GetSystemEnv

### Syntax

    GetSystemEnv(string varName)

### Parameters

`varName` | The environment variable to retrieve.

### Usage

Returns the string associated with the specified environment variable.

Examples:

    val = GetSystemEnv("name")

    try
    {
        x = Int(GetSystemEnv("someNumber"))
    }
    catch (err_msg)
    {
        x = 0
    }

## GetWorkingDir

### Syntax

    GetWorkingDir()

### Usage

Returns the full path of the current working directory. The path is guaranteed to have a trailing slash ('`\`').

## SetWorkingDir

### Syntax

    SetWorkingDir(string path)

### Usage

Sets the path to the current working directory.

## GetFileInfo

### Syntax

    GetFileInfo(string filename, string propertyName)

### Parameters

`filename` | The name of the file.
`propertyName` | The name of the property to retrieve. Can be one of:

`"creationTime"` | The date and time the file was created.
`"modificationTime"` | The date and time the file was last modified.
`"accessTime"` | The date and time the file was last accessed.

### Usage

Returns the property value for the specified file.

Examples:

    filename = "D:\someFile.avi"
    AVISource(filename)
    Subtitle(GetFileInfo(filename, "creationTime"))

## Revision History

- 0.3.0
  - Added `SetWorkingDir`.
- 0.2.0
  - Added `GetFileInfo`.
  - Fixed a buffer overflow in `GetWorkingDir`. Oops.
- 0.1.1
  - `GetSystemEnv` and `GetWorkingDir` now throw errors instead of returning the "undefined" AviSynth value.
- 0.1.0
  - Initial release.