Skip to content

ZosUnixDirectory

The ZosUnixDirectory object represents a Unix directory. The ZosUnixDirectory class is derived from ZosUnixObject. The root directory for the Unix file system can be obtained from the UnixRootDirectory property of ZosServer. The directory represented by a Unix folder can be obtained from the TargetDirectory property of ZosUnixFolder.

ZosUnixDirectory Properties

ZosUnixDirectory exposes the following properties, all of which are inherited from ZosUnixObject.

Property Type R/W Description
Name String R Directory name. (Inherited from ZosUnixObject).
Path String R Full path name of the directory (for example \\server\Unix\u\judy). (Inherited from ZosUnixObject).
UnixPath String R Unix file system path name (for example /u/judy). (Inherited from ZosUnixObject).
FileType ZosUnixFileType R Type of Unix file system object, which is always Directory for this type of object. (Inherited from ZosUnixObject).
CreationTime DateTime R Creation time. (Inherited from ZosUnixObject).
LastWriteTime R Last update time. (Inherited from ZosUnixObject).
LastAccessTime DateTime R Last access time. (Inherited from ZosUnixObject).
User String R User owner. (Inherited from ZosUnixObject).
Group String R Group owner. (Inherited from ZosUnixObject).
UserAccess ZosUnixAccess R/W User access permissions. (Inherited from ZosUnixObject).
GroupAccess ZosUnixAccess R/W Group access permissions. (Inherited from ZosUnixObject).
OtherAccess ZosUnixAccess R/W Other access permissions. (Inherited from ZosUnixObject).

ZosUnixDirectory Methods

ZosUnixDirectory exposes the following methods, some of which are inherited from ZosUnixObject.

CheckAccess Method

Checks whether or not the user has the specified access permissions for the Unix directory. (Inherited from ZosUnixObject).

Boolean  CheckAccess(  
        ZosUnixAccessCheck flags  
        ) 

Create Method

Creates a new directory.

static ZosUnixDirectory  Create(  
        ZosUnixDirectory parent,  
        String name,  
        ZosUnixAccess userAccess,  
        ZosUnixAccess groupAccess,  
        ZosUnixAccess otherAccess  
        ) 

GetObject Method

Gets a single file system object from the directory. The object can be a directory, a file, or a symbolic link.

ZosUnixObject  GetObject(  
        String name  
        ) 

GetObjects Method

Gets an array of file system objects belonging to a Unix directory. The list can optionally be filtered.

nameFilter - Name filter

changeTime - get files changed after the specified time.

Overloads

GetObjects()

ZosUnixObject[]  GetObjects()

...

ZosUnixObject[] GetObjects(String)

ZosUnixObject[]  GetObjects( 
        String nameFilter 
        )

...

ZosUnixObject[] GetObjects( DateTime changeTime )

ZosUnixObject[]  GetObjects(  
        DateTime changeTime  
        ) 

...

ZosUnixObject[] GetObjects(String, DateTime)

ZosUnixObject[]  GetObjects(  
        String nameFilter,  
        DateTime changeTime  
        )

...

Refresh Method

Refreshes the Unix file system information. (Inherited from ZosUnixObject).

void  Refresh() 

Remove Method

Removes the directory and, optionally, deletes the directory contents.

void Remove( 
        Boolean deleteContents 
        )

Rename Method

Renames the directory. (Inherited from ZosUnixObject).

void Rename(  
        String newName  
        ) 

...

ZosUnixDirectory Examples

Examples of using ZosUnixDirectory are shown below.

C

ZosUnixDirectory dir;
ZosUnixObject file = dir.GetObject(“WarAndPeace.txt”);
ZosUnixObject[] files = dir.GetObjects(“X*”);
dir.Rename(“Garbage”);
dir.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write;

...

C++

ZosUnixDirectory^ dir;
ZosUnixObject^ file = dir.GetObject(“WarAndPeace.txt”);
array<ZosUnixObject^>^ files = dir.GetObjects(“X*”);
dir.Rename(“Garbage”);
dir.OtherAccess = ZosUnxAccess::Read | ZosUnixAccess::Write;

...

Visual Basic

Dim dir As ZosUnixDirectory
Dim file As ZosUnixObject = dir.GetObject(“War.txt”)
Dim files() As ZosUnixObject[] = dir.GetObjects(“X*”)
dir.Rename(“Garbage”)
dir.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write

...

Jscript

var dir: ZosUnixDirectory;
var file : ZosUnixObject = dir.GetObject(“WarAndPeace.txt”);
var files : ZosUnixObject[] = dir.GetObjects(“X*”);
dir.Rename(“Garbage”);
dir.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write

...

Back to top