Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: Advanced Server/9000 Administrator's Guide > Chapter 2 Handling Files

Managing Files between HP-UX and DOS Clients

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The Advanced Server/9000 runs as an application on the HP-UX operating system. The server computer may contain files that are accessible to HP-UX system users but are not accessible to clients. Conversely, files created on clients may not be accessible to HP-UX system users

This section contains information for making the files on your network accessible to users working in different environments. Some of the tools you will use to make files accessible are special commands available on the Advanced Server/9000. These commands enable you to do the following:

  • List and rename HP-UX system files.

  • Convert text files from DOS format to HP-UX system format and vice versa.

  • Change the HP-UX system access permissions of files and subdirectories

To access these commands you must connect to the shared directory DOSUTIL. If you want to have access to this directory every time you start your PC, you may enter a net use command in a batch file, profile, or login script. You can run these commands from the DOS prompt of a DOS-based client. You cannot run them from the DOS prompt of an NT client.

In addition, you can use some of these special commands on your PC to execute HP-UX system commands on the server. The following table lists the special commands and the sections in which they are described.

Command

Section

udir

"Displaying Filenames in HP-UX System Format"

uren

"Renaming HP-UX System Files"

uchmod

"Changing HP-UX System Permissions for Advanced Server/9000 Files"

ud

"Using ud to Convert between DOS and HP-UX"

NOTE: These commands may not work reliably under Windows for Workgroups 3.11.

Displaying Filenames in the HP-UX System Format

The udir command enables you to display the contents of a directory on the server. The format of the display is similar to that displayed by the HP-UX system ls -l command. The udir command is useful when you want to display files and directories that are valid to the HP-UX system but invalid to the DOS system or when you want to see the HP-UX system access permissions and ownership of files and directories.

To use the udir command, do the following:

  1. Connect to the shared directory for example, E:, containing the udir command usually \\server1\DOSUTIL and set your PATH variable to that drive.

  2. Connect to the shared directory whose contents you wish to display.

  3. At the DOS prompt, type the following:

    udir pathname

  4. Press <Return>.

Replace pathname with the full path of the directory whose contents you wish to display.

The following is an example of a directory list in HP-UX system format:

DOS-PROMT H:\KHOA\TEST>udir h:\khoa\test 
Volume in drive H: is TESTSRV
Directory of h:/khoa/test/*
UNIX-based server 'TESTSRV' in share area 'UXUSERS'

DOS Name UNIX Name Owner Group Modes
. . khoa katy rwxr-xr-x <DIR> 3-13-95 8:44a
.. .. khoa katy rwxrwxr-x <DIR> 3-13-95 8:43a
name_too_long khoa katy rw-r--r-- 27 3-13-95 8:43a
NET.DIR net.dir khoa katy rwxr-xr-x <DIR> 3-13-95 8:43a
OK_FOR.DOS ok_for.dos khoa katy r--r--r-- 6243 3-13-95 8:43a
ROOTFILE rootfile root sys r--r--r-- 2191 3-13-95 8:44a

6 Files 203.98 Megabytes free

The following list describes each column on the screen:

  1. DOS Name—DOS file and directory names. The entry "." is an abbreviation for the current directory. The entry ".." is an abbreviation for the next higher level, or parent directory. These abbreviations have the same meaning in the DOS and HP-UX operating systems.

  2. UNIX name—HP-UX system file and directory names. The file named name.too.long appears under this HP-UX system column only because this filename is invalid on the DOS file system. Filenames up to 1024 characters long can be displayed in this column.

  3. Owner—The HP-UX system owner of the file or directory.

  4. Group—The HP-UX system group to which the file or directory belongs.

  5. Modes—HP-UX system access permissions for the file or directory.

  6. Size—The size of the file, in bytes. Directories are identified by <DIR>.

  7. Date—The date when the file or directory was most recently modified.

  8. Time—The time when the file or directory was most recently modified.

Using the udir Command on Local Client Drives

If you use the udir command to list a physical disk drive on your client (for example, drive A:, B:, or C:), it provides a display similar to that of the DOS dir command. This display also includes an DOS access permissions column similar to that displayed by the HP-UX system ls -l command.

NOTE: When you enter the udir command, you can specify a single filename if you want to display one file only, or use the wildcard characters ( * and ? ) to display multiple filenames.

The following is a sample udir display of directories and files on a client's local hard disk:

C:> udir
Directory of c:.
ansi.sys rw--a 1651 5-09-92 11:05a
autoexec.bat rw--a 145 11-08-92 8:00a
config.sys rw--a 344 11-08-92 9:30a
landoc rw--a <DIR> 9-10-92 7:30a
dos3_2 rw--- <DIR> 10-10-92 11:08a
fouri.scr rw--a 8007 10-04-92 9:34a
ibmdos.com r-hsa 28009 9-12-92 3:45p
lanman.scr rw--a 1054 11-24-92 4:45p
report1.dft rw--a 8128 9-02-92 5:30p
report2.dft rw--a 9012 10-06-92 9:30a
old.scr rw--a 2045 8-08-92 8:30p
list rw--a 3206 11-08-92 4:04p
12 Files 19.13 Megabytes free
C:>

Renaming HP-UX System Files

The uren command enables you to rename an HP-UX system file or directory. Specifically, you can use it to change HP-UX system filenames on the server that are invalid for the DOS system to filenames that are valid.

This command is useful if you created a file while logged in as an HP-UX system user and now want to access that file from an DOS client.

To rename an HP-UX system file, follow these steps at the DOS prompt on a client:

  1. Connect to the shared directory on the server that contains the uren command (usually \\server1\DOSUTIL), and set your PATH variable to that drive.

  2. Use the cd command to change to the directory that contains the file.

  3. Type the following:

    uren name1 name2

    where: name1 is the current HP-UX system filename.

    and name2 is the new filename. (Make sure that the new filename complies with the DOS filename conventions.)

  4. Press <Return>.

Using the uren Command to Move Files

Because the uren command accepts full pathnames, you also can use it to move a file from one HP-UX system directory to another. For example, to move the file budget from the report subdirectory to the memos subdirectory, and to rename the moved file 1qbudget, enter the following command:

uren \report\budget \memos\1qbudget

The uren command also enables you to move one or more files to another directory by entering the command in the following format:

uren name1 name2 ... directoryname

Replace directoryname with the name of the destination directory.

NOTE: You cannot use the DOS wildcard characters (* and ?) with the uren command. In addition, you cannot use the uren command to move a file from one drive to another.

Changing HP-UX System Permissions for AS/U Files

Because the Advanced Server/9000 runs on the HP-UX operating system, all Advanced Server/9000 files stored on the server are HP-UX system files with HP-UX system access permissions. The HP-UX system access permissions on an Advanced Server/9000 file will always agree with the Advanced Server/9000 access permissions unless the HP-UX system access permissions are explicitly changed. If HP-UX system access permissions are modified, they can prevent access to a file or directory even if Advanced Server/9000 access permissions grant access to the resource.

The uchmod command enables you to change HP-UX system access permissions on a file to resolve access conflicts.

Use the udir command to display the current HP-UX system access permissions for a file.

Handling Incompatible File Formats

Different operating systems store files in different formats. For this reason, even if you can connect to a shared directory that contains a file you wish to use, you may not be able to open the file, or if you are able to open the file, it may be inappropriately formatted for your environment.

For example, suppose the following file was created with an HP-UX system text editor:

Dear Bob:
This letter is in response to your inquiry of February 25.
The information you requested is enclosed, along with other
materials that should help you evaluate our product line.

If you look at this file with the DOS type command, you would see the following:

Dear Bob:
This letter is in response to your inquiry of February 25.
T
he information you requested is enclosed, along with other
ma
terials that should help you evaluate our product line.

Similarly, if you had created the original file using an DOS editor and listed it with the HP-UX system cat -v command, you would see the following:

Dear Bob:^M
^M
This letter is in response to your inquiry of February 25.^M
The information you requested is enclosed, along with other^M
materials that should help you evaluate our product line.^M
^Z

This is because, in the HP-UX system, each line of text ends with a line-feed character. In the DOS system, however, each line of text ends with a carriage-return character, followed by a line-feed character.

If you need to convert text files from one operating system format to another, the Advanced Server/9000 provides a conversion utility, the ud command, which is described in the next section. The ud command can be used to translate a text file from DOS format to the HP-UX system format, or vice versa.

Using ud to Convert between DOS and HP-UX

The ud command converts a text file from DOS to HP-UX format or HP-UX to DOS. It is intended only for text files. Do not use this command on non-text data or executable files. The ud command is available in the DOSUTIL share or the HP-UX command prompt in /opt/asu/lanman/bin.

To convert a file, do the following:

  1. Connect to the shared directory containing the ud command (usually \\server1\DOSUTIL and set your PATH variable to this drive.

  2. At the DOS prompt, type the following:

    ud [ option ] filename1 > filename2

Replace option with one of the three options discussed in the next section, or leave it blank to convert DOS to HP-UX and vice versa. Replace filename1 with the name of the original file. Replace filename2 with the name for the new, converted file. The filenames must be different from each other. For example, to convert an HP-UX file named hpuxtext to a DOS file named systext, type the following:

ud -d hpuxtext > systext

Press <Return>.

The ud command rewrites the file hpuxtext in DOS format and puts it in a file named systext. The original hpuxtext file remains unchanged.

Guidelines for Using the ud Command

When you are not sure of the format of a text file, use the ud command with the -d or -u option to convert the file to the format you need. If the file is already in that format, the command output (filename2) will be identical to the original file.

If you do not enter a second filename, the file is converted and its text is displayed on your screen.

CAUTION: If you enter a second filename, be sure the filename is different from the first filename. If the filename is the same, the contents of the file that you want to convert will be deleted.

Options

The ud command has the following options:

  • -d Converts a file to DOS format.

  • -u Converts a file to HP-UX system format.

  • -m Converts a file to Macintosh format.

  • -z Affects the ^z character. DOS files often have ^z as the last byte in the file. When converting an HP-UX system file to DOS format, the -z parameter does not put ^z at the end of the file. When converting an DOS file, the -z parameter forces ud to ignore any ^z characters in the file. Without the -z parameter, the conversion stops when the first ^z is encountered.

    NOTE: If you use either -d or -u for a file that is already in the specified conversion format, the file remains unchanged and a new file is also created in the specified format.

Piping and Redirecting Converted Files

You can use the pipe operator ( | ) with the ud command to send a reformatted file to a program.

For example, to convert a file named hpuxtext from HP-UX system format to DOS format and display the converted file a screenful at a time, pipe the output of ud to the DOS more utility by entering the following command:

ud -d f:hpuxtext | more

Press <Return>.

In this example, drive F: is linked to the server directory that contains the hpuxtext file, and the more utility is in your path.

Piping is especially useful with DOS commands, such as sort, which use a carriage return to determine where each line ends in the file. Because files in HP-UX system format do not identify line ends by carriage returns, the files must be converted to DOS format for the sort command to operate properly. You can then pipe the converted text to the sort command. For example, type the following:

ud -d hpuxtext | sort

This example displays the sorted text on your screen. To store the results in a new file called text.srt, you can use the redirection character (>) as follows: ud -d hpuxtext | sort > text.srt

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.