ZosUnixFile
The ZosUnixFile object represents a Unix file. The ZosUnixFile class is derived from ZosUnixObject.
ZosUnixFile Properties
ZosUnixFile exposes the following properties, most 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\abc.txt. (Inherited from ZosUnixObject). | |||
UnixPath | String | R | Unix file system path name (for example /u/judy/abc.txt). (Inherited from ZosUnixObject). |
FileType | ZosUnixFileType | R | Type of Unix file system object, which is always File for this type of object (Inherited from ZosUnixObject). |
FileSize | Int64 | R | File size (bytes) |
FileFormat | ZosUnixFileFormat | R | File format |
CreationTime | DateTime | R | Creation time (Inherited from ZosUnixObject). |
LastWriteTime | DateTime | 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). |
...
ZosUnixFile Methods
ZosUnixFile 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 file. (Inherited from ZosUnixObject).
Boolean CheckAccess(
ZosUnixAccessCheck flags
)
CopyTo Method
Copies the file to another Unix file. You can optionally replace an existing file with the same name.
void CopyTo(
String path,
Boolean replaceExisting
)
Create Method
Creates a new empty file.
static ZosUnixFile Create(
ZosUnixDirectory parent,
String name,
ZosUnixAccess userAccess,
ZosUnixAccess groupAccess,
ZosUnixAccess otherAccess
)
Delete Method
Deletes the file. (Inherited from ZosUnixObject).
void Delete()
Export Method
Copies the file to a data set or PDS member.
void Export(
String dsname,
String member [optional]
)
Import Method
Copies the file from a data set or PDS member.
Void Import(
String dsname,
String member [optional]
)
Refresh Method
Refreshes the Unix file system information. (Inherited from ZosUnixObject).
void Refresh()
...
Rename Method
Renames the file. You can optionally replace an existing file with the same name. (Inherited from ZosUnixObject).
void Rename(
String newName,
Boolean replaceExisting )
ZosUnixFile Examples
Examples of using ZosUnixFile are shown below.
C
ZosUnixFile file;
file.CopyTo(“/u/MarthStewart/Recipes/GritsAndJowls.txt”);
file.Import(“MY.GARBAGE.DATA”);
file.Rename(“HumptyDumpty.txt”, true);
file.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write;
...
C++
ZosUnixFile^ file;
file.CopyTo(“/u/MarthStewart/Recipes/GritsAndJowls.txt”);
file.Import(“MY.GARBAGE.DATA”);
file.Rename(“HumptyDumpty.txt”, true);
file.OtherAccess = ZosUnxAccess::Read | ZosUnixAccess::Write;
...
Visual Basic
Dim file As ZosUnixFile
file.CopyTo(“/u/MarthStewart/Recipes/GritsAndJowls.txt”)
file.Import(“MY.GARBAGE.DATA”)
file.Rename(“HumptyDumpty.txt”, true)
file.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write
...
Jscript
var file: ZosUnixFile;
file.CopyTo(“/u/MarthStewart/Recipes/GritsAndJowls.txt”);
file.Import(“MY.GARBAGE.DATA”);
file.Rename(“HumptyDumpty.txt”, true);
file.OtherAccess = ZosUnxAccess.Read | ZosUnixAccess.Write;
...