Skip to main content

Problem:

Demonstration of CBL_DIR_SCAN_library routine usage.

Resolution:

BUILD W/RELEASE:     Server Express 2.2SP1 or later, or  NetExpress 4.0 or later

Overall, the process is similar to opening a file, reading and processing "records" (directory entries in this case) until an "end" condition is encountered.

Also demonstrates use of CBL_GET_OS_INFO to deal with  Unix and Windows platform specifics.

SOURCE FILES:

==========

Program Files     Description

----------------     -----------------------------------------------------------

dirdemo.cbl        Complete demonstration

Copy Files: Uses Micro Focus-supplied copy files.  Environment variable COBCPY must include product's cobcpy directory in its value.

REQUIREMENTS:

==========

Server Express version 2.2SP1 or later, or NetExpress version 4.0 or later.

OPERATION:

========

NetExpress: Do a debug build and animate.

Server Express:

   cob dirdemo.cbl ;

   anim dirdemo

   Step through animation, watch what the program does. First, it determines whether the environment is Unix or Windows. Then it reads the content of directory /var (Unix) or C:\\ (Windows) to the end, displaying results.

REFERENCES

========

Server Express manual File Handling, chapter File Handling Library Routines.

NOTE:

====

Although the program writes screen output, the real value of the demonstration lies in observation via the Animator.

The source file is in Unix format.  It will display and  compile correctly with NetExpress.  It will display correctly with Wordpad or Quick View, but not with Notepad.

==========================================================

Keywords: Example, sample, demo, demonstration, UNIX, dirdemo.zip

demo.ex

demo.ne

demo.se

Attachments:

Dirdemo.zip

Old KB# 3684