Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Reflection NFS and ASCII End-of-Line File Format
Technical Note 1548
Last Reviewed 07-Jul-2005
Applies To
Reflection NFS Client version 10.0 or higher
Summary

The Reflection NFS client provides several methods for translating ASCII file end-of-line characters from DOS (Windows) format to UNIX format, or from UNIX to DOS (Windows) format. This technical note lists and explains each of these options.

Note the following:

  • The Reflection NFS Client standalone product is also included as a component of several Reflection products. For further details, refer to Technical Note 3000.
  • For information about which versions of Reflection NFS are supported on each Microsoft Windows platform, see Technical Note 1866.

File Translation Options

Windows (DOS) and UNIX use different non-visible characters to indicate the end of each line of text in an ASCII file. Windows uses a CRLF (Carriage Return, Line Feed) to indicate the end of a line of ASCII text, while UNIX uses only a CR (Carriage Return).

Because these end-of-line indicators differ between the two operating systems, to edit a UNIX file in Windows you must first translate the UNIX end-of-line characters to the appropriate Windows format. The opposite is true for a file created in Windows and edited in UNIX.

Warning: You risk corrupting the file if you do not translate the end-of-line characters before editing a UNIX file in Windows, or a Windows file in UNIX. Some applications display these types of files as if they have been translated, even though the actual end-of-line characters have not been changed. Editing a file that has been converted only for display can create files that contain mixed end-of-line characters and may cause file corruption.

Reflection NFS client provides several ways to perform this file format translation. The following sections detail these methods.

Note: These utilities convert only CR to CRLF, or CRLF to CR. They provide no other file translation support.

Using Right-Click Drag and Drop

This option works only when moving files from one folder location to another. Follow the steps below to use this functionality:

  1. Open Windows Explorer and navigate to the files on your NFS host.
  2. Right-click the file or group of files you wish to convert and drag the files to the new folder location. When you release the right mouse button, you will see a menu. Click Copy Here with NFS File Translation:
Figure 1 - Menu Items Figure 1 - Menu Items
  1. In the NFS ASCII File Translation dialog box, select Translate UNIX to DOS or Translate DOS to UNIX. (For further translation parameters, click the Options button).
  2. Click OK.

Using the NFS Utility

If the files you want to translate are on a mapped NFS drive, you can translate the end-of-line characters using the NFS Utility. Follow the steps below to use the NFS Utility's file translation options:

  1. Open the NFS Utility.
  2. In the NFS Utility, select your NFS mapped drive and navigate to the files or group of files you wish to translate.
  3. Select the file or group of files and click File on the NFS Utility menu bar.
  4. Select Translate UNIX to DOS or Translate DOS to UNIX, and then fill in the appropriate information fields.
  5. Click OK.

Converting Files from the Windows Command Prompt

If you need to convert files from a Windows Command Prompt or a batch file, Attachmate provides two Reflection NFS file translation executables; Dos2unix.exe and Unix2dos.exe. These files can be obtained from the Reflection NFS Products section of the Reflection Download Library at:

As the file names indicate, Dos2unix.exe converts DOS end-of-line characters to UNIX format, and Unix2dos.exe converts UNIX end-of-line characters to DOS format. Further syntax and usage information can be obtained by typing: Dos2unix.exe /? or Unix2dos.exe /?.

Note: These utilities rely on Reflection NFS client product files, and can thus only be used on a PC where Reflection NFS client is installed.

Using Host Side Translation

Some host operating systems or NFS server side software provide support for automatic file translation when a file is copied or moved from the host using NFS. For further information regarding this topic, check your host documentation or contact your host vendor.

Related Technical Notes
1421 Reflection NFS Client: Frequently Asked Questions (FAQ)
3000 Reflection Suites
5008 Technical Notes for Reflection NFS Products

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.