APGen Documentation Previous Topic: Output.Filename Next Topic: Output.Path Parent Topic: Output Object    Output Object
Output.Dir
See Also:

The Output.Dir property sets/returns the directory containing the output file.

Syntax

VBScript:

Output.Dir [= strDir]

JScript:

Output.Dir [= strDir];

Parameters

strDir A string indicating the directory of the output file.  Relative or absolute paths may be used.

Notes

When setting the Dir property, the strDir parameter may be an absolute path or a relative path.  Relative paths are resolved using the previous Output.Dir value.  The Path value is adjusted to fit the new directory.  The Filename value is not changed.

For a list of valid path formats, see the Output.Path documentation.

When reading the Dir property, the complete directory path is returned.

The Path value is a combination of the Dir value and the Filename value.  When Output.Open() is called, the Path value is used to determine the location of the output file.

The initial, default value for Output.Dir is the directory where the root script resides.  When a script is run using programmatic execution, this default can be changed by setting the APGen.OutputDir property.

Changing the value of the Dir property after an output stream has been opened closes the stream.  New content will be sent to a file determined by combining the new Dir value with the Filename value.

Example

The following example, hello.apg, shows proper use of the Output.Dir property:

<%#
Output.CanCreateDirs = True
Output.Dir = "C:\InetPub\wwwroot\hello"
Output.Filename = "default.htm"
#%>

<HTML><HEAD>
<TITLE>Hello World, generated by APGen</TITLE></HEAD>

<BODY><H2>
Hello World!
</H2>
This file was generated by Active Page Generator.
</BODY></HTML>

Applies To

Output Object