Using the OpenStep Desktop
  Искать только в названиях книг
Загрузить это руководство в формате PDF

Creating and Saving Files

5

Whenever you create a document (for example, a text report, an illustration, or a spreadsheet), you start by creating a file. All the work you do is kept in that file when you save it. You can change it and save the changes, or you can save different versions of the file.
This chapter describes how to do the following:
  • Create a file
  • Open a file
  • Save a new file
  • Save changes
  • Save another version of a file

Creating a File

When you want to create something new, you start the application you want to use, open a new window, and begin to work in it.
You open the window with the New command in the document menu, as shown in Figure 5-1 on page 5-2. This menu might be called Document, Image, Project, or whatever describes what you create with the application.
  1. Start the application you want to use.

  2. Choose the command that opens the document menu.

  3. Choose New.

Графика

Figure 5-1

You store the work you do in a file. You name the new file and put it in a folder when you first save the contents of the new window.
If you close the window without saving, no file is created and work you have done in the window is lost.
Some applications give you a new window automatically when you start them from the dock or when you open their files from the File Viewer.

Opening a File

You can open a file while you are working in an application. Use the Open panel, which contains a small browser that lists the files the application can open, as shown in Figure 5-2. You locate a file in this browser just as you locate a file with the browser view in the File Viewer.
  1. Choose the command that opens the document menu.

  2. Choose Open.

  3. In the Open panel, select the file or files you want to open.

  4. Click on OK.

Графика

Figure 5-2

Instead of selecting the file you want to open in the browser, you can type its path name, as shown in Figure 5-3 on page 5-4. If the file is further down the branch of the file system from the folder that is currently open in the panel, you only need to type the part of the path name that begins with a name in that folder.

Графика

Figure 5-3


Note - You can double-click on a file in the browser to open the file without having to click on OK. You can also open more than one file by selecting the files you want to open--for example, by dragging over them--and clicking on OK.

When you open a file, the panel goes away and the contents of the file are displayed in a window.

Note - You can use the same shortcuts to typing path names in the Open panel as you can in the Finder. See "Shortcuts to Typing Path Names" on page 3-30.

For more information on using a browser, see "Browsing Files and Folders" on page 3-13.
You can use the disk buttons in an Open panel to open and eject floppy disks. See "Opening and Saving Files on a Floppy Disk" on page 8-10.

Saving a New File

To name a new file and put it in a folder, you must save it. When you are working in a new window and you choose Save, a panel opens that contains a browser (see Figure 5-4 on page 5-5). Locate and open a folder in this browser just as you do with the browser view in the File Viewer.
  1. Choose the command that opens the document menu.

  2. Choose Save.

  3. In the Save panel, name the file and open the folder in which you want to put it.

  4. Click on OK.

Графика

Figure 5-4

When you save a file, the Save panel closes and the file is placed in its folder, as shown in Figure 5-5.

Графика

Figure 5-5

Guidelines for Naming Files and Folders

You can choose nearly any name you want for a file or folder. Just keep the following in mind:
  • You cannot use the same name more than once in the same folder. However, you can use the same name in different folders.
  • Lowercase letters are distinguished from uppercase letters, so Fall Catalog is the name of one file and fall catalog is the name of another file.
  • You can use any characters except a slash (/), which separates names in a path name. It is better to avoid spaces and the ' " & | - and ^ characters, which have special meanings in UNIX(R).
  • Remember that the extension at the end of most file names associates the file with an application. If you do not include the extension when you name the file, the application adds it automatically.

Tricks in the Name Field

Instead of selecting a folder to save a file in, you can type a path name for the file in the Save panel. Use the same shortcuts described in "Shortcuts to Typing Path Names" on page 3-30.
To save the file further down the branch of the file system from the folder that is currently open in the panel, type just the part of the path name that begins with a name in that folder. In the panel Figure 5-4 on page 5-5, for example, type Catalogs/FallCatalog to save FallCatalog.rtfd in the Catalogs folder.
You can also create a folder in which to save a file. Type a path name for the file that includes the folder's name as though the folder already exists. Type Festival/Program, for example, to create a Festival folder and save Program.rtfd in it. In the panel that asks if you want to create the folder, click on Create.
To replace a file with the one you are saving, select the file you want to replace and click on OK. In the panel that asks if you want to replace the file, click on Replace.

Saving Changes

You save changes you make to a file so they are there when you next open the file. Just choose Save while working in the window that contains the file. The contents of the window replace the previous version of the file on disk. The window stays on the screen so you can keep working in the file (see Figure 5-6).
* To save changes in a file, open the document menu from the main menu and then choose Save from the document menu.
* To save changes in all the files open in an application, choose Save All from the document menu.

Графика

Figure 5-6

You can undo changes you do not want to keep with the Revert to Saved command in the document menu. See "Standard Commands" on page A-1.

Note - You should save changes periodically as you work in a file, not just when you are about to close it. By saving frequently, you avoid losing a lot of work if the file closes unexpectedly--for example, if there is a power failure.

If you choose Save All when any window in the application contains work that has not yet been saved, a Save panel opens. You can then name the file and put it in a folder.

When You Save an Edit Document

When you save an Edit document, Edit creates a temporary backup file, which contains the version of the file without the changes you are saving. Edit deletes this backup file as soon as the new version is successfully saved on disk.
If something happens that prevents Edit from saving the file--a power failure, for example--the backup copy remains, and you can recover its contents. You can tell which is the backup copy because it has the same name as the original file but with a tilde (~) appended to it. For example, the backup copy for Memo.rtf would be Memo.rtf~.
If you only the backup file remains, you can remove the ~ from the name and use it in place of the original. See "Renaming a File or Folder" on page 6-4.

Saving Another Version of a File

You can save the contents of a file under a different name and in a different folder while keeping the original file too. You typically do this to save one version of a file before making any more changes to it.
Both the Save As and Save To commands save the contents of the window you are working in as another file. Each command opens the Save panel, where you name the new version of the file and put it in a folder, just as you do for a new file (see Figure 5-7 on page 5-9). The original file stays the same as when you last saved it.
  1. Open the document menu from the main menu.

  2. Choose Save As or Save To from the document menu.

  3. In the Save panel, name the new version and open the folder in which you want to put it.

  4. Click on OK.

Графика

Figure 5-7


Note - You can think of these commands as taking a snapshot of the file and putting the snapshot away, while you continue to work in the other version of the file. Save As puts a snapshot of the original version aside, and Save To puts a snapshot of the revised version aside.

Why Save?

When you work in a file--for example, by typing in an Edit document--the system displays your work in a window. But it does not retain your work permanently on disk until you save the file.
Before closing a window that contains a file you have been working in, you need to save your changes if you want them to be there the next time you open the file. If you close the file without saving, the changes are not copied onto the disk and they are there when you next open the file.

Графика

Figure 5-8