PATH Examples


 

The following examples assume a disk tree structure as such:

 

 

C:\

 

C:\PLB

 

C:\PLB\PROG

 

C:\PLB\TESTDATA

 

C:\PLB\LIVEDATA

 

Example 1:

 

  

PATH

CURRENT,PATHVAR

(Current is C:\PLB)

 

 

Variable

PL

FP

LP

Contents

Before:

PATHVAR

12

1

2

C:••••••••••

 

After:

PATHVAR

12

1

10

C:\PLB••

 

No Condition Flags are set (all FALSE).

 

Example 2:

 

  

PATH

CURRENT,PATHVAR

(Current is C:\PLB\PROG)

 

 

Variable

PL

FP

LP

Contents

Before:

PATHVAR

12

1

2

C:••••••••••

 

After:

PATHVAR

12

1

12

C:\PLB\P

 

The EOS Condition Flag is set. PATHVAR could not contain all of the information.

 

Example 3:

 

  

PATH

CHANGE,"C:\PLB\LIVEDATA"

 

No Condition Flags are set (all FALSE) because the CHANGE was to a valid path.

 

Example 4:

 

  

PATH

CHANGE,"DUMMY"

(Current directory is C:\PLB)

 

The OVER Condition Flag is set because the given path (C:\PLB\DUMMY) did not exist.

 

Example 5:

 

  

PATH

CREATE,"NEWDATA"

(Current directory is C:\PLB)

 

No Condition Flags are set (all FALSE). C:\PLB\NEWDATA was created since it did not already exist as a file or directory.

 

Example 6:

 

  

PATH

CREATE,"PROG"

(Current directory is C:\PLB)

 

The OVER Condition Flag is set because the given path (C:\PLB\PROG) already existed as a directory (same error would have occurred if it had been a file).

 

Example 7:

 

  

PATH

DELETE,"TESTDATA" (Current directory is C:\PLB)

 

Since C:\PLB\TESTDATA exists, it is deleted only if it is empty (no files or subdirectories contained therein) and no Condition Flags are set. However, if it contained files or subdirectories that had not been previously deleted, it is not deleted, even though a valid path, and the OVER Condition Flag is set.

 

Example 8:

 

  

PATH

DELETE,"DUMMY"

(Current directory is C:\PLB)

 

The OVER Condition Flag is set. C:\PLB\DUMMY does not exist.

Example 9:

 

 

PATH

CREATE,"c:\temp\subdir|192.168.1.10:3934"

 

PATH

EXIST,"c:\temp\subdir|192.168.1.10:3934"

 

PATH

DELETE,"c:\temp\subdir|192.168.1.10:3934"

 

MOVE

"|192.168.1.10:3934", SVAR

 

PATH

CURRENT,SVAR

 

PATH

CHANGE,"c:\temp" ;PLB_CURDIR required at SUNDM!

 

These examples show PATH instructions executed at the Data Manager.

 



PL/B Language Reference PARSEFNAME Example PAUSE Example