Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
DO NOT ALTER this OV Built-In Function as it is used by LANSA programs. If you create a customized version of this Built-In Function, create a copy and amend the copy.
The user of this Built-In Function is responsible for any impact it has on any application. No warranty of any kind is expressed or implied. Refer to full Disclaimer.

Function No:

992

DLL Required:

U_BIF992.DLL

For use with

Visual LANSA for Windows

YES


Visual LANSA for Linux

YES


LANSA for i

Yes

Only available for RDMLX.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Type of file service required. Pass as one of:

MAKE_DIR  Make Directory.

REMOVE_DIR  Remove Directory.

REMOVE_DIR_TREE  Remove a directory tree recursively. Be careful!

CHECK_DIR  Check if directory exists.

CHECK_FILE  Check if a file exists.

SET_FILE  Set a file's attribute to read only or normal (read/write).

COPY_FILE  Copy a file to another file.

REMOVE_FILE  Remove file.

GET_DIR  Get contents of a directory.

COPY_DIR  Copy a directory and all its sub-directories to another directory. Any matching files in the target directory will be replaced.

COPY_PATTERN  Copy files matching the specified pattern to another directory. Any matching files in the target directory will be replaced.

1

256



2

A

Opt

Requested Service Argument 1

When Arg 1 is
      Pass this argument as:

MAKE_DIR  Name of directory to be made.

REMOVE_DIR  Name of directory to be removed.

REMOVE_DIR_TREE  Name of the directory to be removed.

CHECK_DIR  Name of directory to be checked for.

CHECK_FILE  Name of file to be checked for.

SET_FILE  Name of file to be set.

COPY_FILE  Name of file to be copied from.

REMOVE_FILE  Name of file to be removed /deleted.

GET_DIR  Name of directory whose contents are to be returned.

COPY_DIR  Name of the directory to be copied.

COPY_PATTERN  Fully qualified path with file pattern to be copied.  Note * is the only wildcard that is supported.

1

256



3

A

Opt

Requested Service Argument 2.

When Arg 1 is
      Pass this argument as:

MAKE_DIR  Not required. Do not pass.

REMOVE_DIR  Not required. Do not pass.

REMOVE_DIR_TREE  Optional (only supported on MS Windows and Linux).

Pass FORCE to delete every file even if a files is READ-ONLY. Any other value, or no value, will return an error if a file is read-only.

CHECK_DIR  Not required. Do not pass.

CHECK_FILE  Not required. Do not pass.

SET_FILE  Pass as READ_ONLY or NORMAL.

COPY_FILE  Name of file to be copied to.

REMOVE_FILE  Optional. (only supported on 32 bit MS Windows)

Pass FORCE to delete every file even if a file is READ-ONLY. Any other value, or no value, will return an error if a file is read-only.

GET_DIR  Optional file suffix to select files of only a specific type when retrieving the contents of a directory (e.g: DLL, EXE, DOC).

Do not pass or pass as blanks to select all files.

COPY_DIR  Name of the directory to be copied to.

COPY_PATTERN  Name of the directory to be copied to.

1

256



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Opt

Basic Return Code.
OK = Completed normally.
ER = Error occurred.

2

2



2

N

Opt

Extended Error Code. This is the operating system error code (when available) that may aid you in error handling or error reporting.

1

15

0

0

3

List

Opt

Returned working List. This list is only returned for certain argument 1 values as follows :

MAKE_DIR  Not returned.

REMOVE_DIR  Not returned.

REMOVE_DIR_TREE  Not returned.

CHECK_DIR  Not returned.

CHECK_FILE Not returned.

SET_FILE  Not returned.

COPY_FILE  Not returned.

REMOVE_FILE  Not returned.

GET_DIR  The working list that is to contain the contents of the directory. It can contain from 1 to 7 fields (i.e. columns) which will be returned as the full file name.
These are:
the real name (full file name)
the file name (without suffix),
the file suffix,
the file date (format YYYYMMDD),
the file time (format HHMMSS),
the file size (which must be a numeric field),
a (sub)directory indicator (which is returned as Y or N) and
Existing contents of this working lists are cleared by this Built-In Function. Refer to the following example for more information.

COPY_DIR  Not returned.

COPY_PATTERN  Not returned.





Examples

The following sample RDML function (which can be copied and pasted in the CS/400 free form function editor) requests that you specify a directory name and then attempts to create it. The basic and extended return codes from the attempt to create the directory are displayed:

...