Solaris Common Desktop Environment: User's Guide

Opening and Saving Documents

You can create a new document or open an existing document. Opening a document displays the contents of a selected file in the Text Editor window.

Saving a document stores the edited contents into a file. You can save a document to its original file or to a new file.

You can choose that Text Editor maintains a file containing the previously saved version of a file each time it performs a save during the current session.

To Create a New Document

A new document named (UNTITLED) is created when you start Text Editor. To enter text in your document, see "Entering Text". You provide a new file name when you save the document.

After finishing a document, you can create another document using the New command.

    Choose New from the File menu.

The Text Editor window is cleared and a new document is created. If you have not saved your current document, a dialog box is displayed that enables you to save your document.

To Save a Document to a New File

  1. Choose Save As from the File menu.

    The Save As dialog box lists files and folders located in your current folder. You can store your document in the current folder, a subfolder, or a folder that you specify.

    If you used Wrap To Fit, the dialog box includes an additional choice about handling line endings. If Wrap To Fit is set off, the dialog box omits this choice (see "Using Wrap To Fit").

    Figure 10-2 Save As dialog box

    Graphic

  2. Optional. If you do not want to save the file to the current folder, choose a subfolder or indicate a different folder.

    • For a subfolder, select the subfolder in the Folders list and press Return.

    • For a different folder, use the .. (go up) icon to change to a folder or type its path name in the Enter path or folder name field.

  3. Type a new file name in the Enter file name field.

  4. Press Return or click OK.


Note -

To save your document to a diskette that has been mounted, choose /floppy/floppy_name through the menu button at the end of the text field, Enter path or folder name. Type a name in the Enter file name text field and click OK.


To Save a Document to the Original File

    Choose Save from the File menu to save your work and continue editing your document.

If you used Wrap To Fit, the Save dialog box includes an additional choice about handling line endings (see "Using Wrap To Fit").

Opening an Existing Document

You can open an existing document in these ways:

To Open an Existing Document from Text Editor

  1. Choose Open from the File menu.

    The Open a File dialog box lists files and folders in your current folder. You can browse the documents listed, or change to a new folder to locate other files on your system.

    Figure 10-3 Open a File dialog box

    Graphic

  2. Select the name of the document you want to open, or type the document name in the Enter file name field.

  3. Press Return or click OK.


    Note -

    You can also use this shortcut: double-click the document name in the dialog box.



    Note -

    To save a file from a CD-ROM or diskette that has been mounted, choose /cdrom/cd_name or /floppy/floppy_name through the menu button at the end of the text field, Enter path or folder name. Select the file name and click OK.


To Open an Existing Document from File Manager

  1. Display the document's file icon in a File Manager window.

    Figure 10-4 Document file icon

    Graphic

  2. Open the document in one of the following ways:

    • Double-click the document.

    • Select the document, then choose Open from the File Manager Selected menu.

    • Drag the document file icon to the Front Panel and drop the icon on the Text Editor control.

Working with Backup Versions

You can choose that Text Editor maintains a file containing the previously saved version of a file each time it performs a save. You do this using the Backup on Save menu item on the Options menu. The default setting is un-selected, so each time you run Text Editor, the setting reverts to the default.

When performing a save with Backup on Save selected, Text Editor first copys the original file to a new file name (the old file name with a percent character "%" appended), and then saves the edited file to the original file name.

To Recover the Backup Version of a File

You can revert to the previously saved version of a file in which you are interested as follows:

  1. Choose Open from the File menu.

    Text Editor displays the Open a File dialog.

  2. Browse to the folder containing the file in which you are interested, and select the corresponding file name with a percent character "%" appended.

    Text Editor opens the file.

  3. Use the Save As command in the file menu to overwrite the original file.

    The original file now contains the contents of the previous version.