| United States-English |
|
|
|
![]() |
HP 9000 Networking: Advanced Server/9000 Administrator's Guide > Chapter 2 Handling FilesManaging Files between HP-UX and DOS Clients |
|
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:
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.
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:
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:
The following list describes each column on the screen:
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.
The following is a sample udir display of directories and files on a client's local hard disk:
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:
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.
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. 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:
If you look at this file with the DOS type command, you would see the following:
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:
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. 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:
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. 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.
Options The ud command has the following options:
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||