Chapter Contents

Previous

Next
SAS/C Cross-Platform Compiler and C++ Development System User's Guide, Release 6.50


Manipulating Files and Directories

Once you are logged in 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 simply by specifying path: where you previously specified a local file name. This will work if the particular program that you are using allowed you to specify the style prefix. For example, CMS programs that let you access CMS Shared File System files using the sf: prefix will now allow you to access NFS file 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 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 which can also be used as simple utilities. For example, there is a simple ls command that lists the files in a directory. There is an ncp command that can copy files between mainframe file systems and NFS file systems (and can be much quicker than getting into FTP). These are simple sample programs. They 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 provided with the SAS/C Cross-Platform Compiler:

Sample Programs
Example Description
cd
Change the directory (requires an ETC_MNTTAB setting)
ls List a directory (no wildcards)
ncp
Copy files between mainframe and NFS file systems
pwd
Print the working directory


Chapter Contents

Previous

Next

Top of Page

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