Chapter Contents

Previous

Next
Using the NFS Client

Manipulating Files and Directories

Once you are logged on and have the remote file systems mounted into the directory structure that you want, you can begin to access files. In many cases you can do this through SAS/C programs that are not aware of NFS by specifying path: where you previously specified a local filename. This will work if the particular program that you are using enabled you to specify the style prefix. For example, CMS programs that enable you to access CMS Shared File System files by using the sf: prefix enable you to access NFS file by using the path: prefix. If the program uses the correct setting for text or binary processing when it opens files, text files will be translated from ASCII to EBCDIC automatically. If it does not, you can use the TEXT and BINARY mount options to override the program's decision.

Existing SAS/C programs can also remove, rename, and check accessibility of NFS files.

If you are not saving file system context (or if you are but have not run a program to change the initial directory), you must use the full pathname (from the mainframe point of view) in order to access a file.

Programs that were developed by using SAS/C CSL can access and manipulate the remote file systems more completely. They can create, delete, and list directories. They can work with hard and symbolic links. They can change or check the current working directory, and they can retrieve and change UNIX or POSIX file-status information.

The SAS/C CSL product contains many sample programs that can also be used as simple utilities. For example, the ls command lists the files in a directory. The ncp command can copy files between mainframe file systems and NFS file systems (and can be much quicker than using FTP). These sample programs do not have the full features of their UNIX equivalents, but they are useful.

The following examples are distributed with the CSL run-time transients that are provided with the SAS/C Cross-Platform Compiler:

Sample Programs
Example Description
cd
Changes the directory (requires an ETC_MNTTAB setting)
ls Lists a directory (no wildcards)
ncp
Copies files between mainframe and NFS file systems
pwd
Prints the working directory


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.