Chapter 27. Library: I/O Utilities

The I/O utility library provides functions for handling input and output. With these functions, you'll be able to read files, write files, obtain input, and display output. Through batch script (.WS) files, you can access these utility functions in any of your scripts. The sections that follow show the source for the library, as well as how the library can be used.

Examining the I/O Utility Library

The code for the I/O utility library is shown in Listing 27-1. When using this script from JScript, be sure to pass path information in JScript format with double slashes as folder separators. With other scripting languages, you normally don't have to use double slashes.

Example 27.1. I/O utility library

iolib.js// ************************
// Script: I/O Utility Library
// Version: 1.1.5
// Creation Date: 05/20/2008
// Last Modified: 06/15/2008
// Author: William R. Stanek
// Email: williamstanek@aol.com
// ************************
// Description: Provides a utility library for reading
//              and writing files.
// ************************ // Copyright (c) 2008 William R. Stanek // You have a royalty-free right to use these applications, // provided that you give credit to the author AND agree that // the author has no warranty, obligations or liability for // any of these library functions. // ************************ function DisplayConsolePrompt(promptText) ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.