home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Complete Idiot's Guide to Linux
(Publisher: Macmillan Computer Publishing)
Author(s): Manuel Ricart
ISBN: 078971826x
Publication Date: 12/22/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Chapter 5
Creating, Editing, and Saving Files

In This Chapter

  Creating a New File
  Opening Existing Files
  Working with the Open Panel
  Saving Changes to Your Documents
  Editing Text

Files store information on the computer’s disk. When you type a letter to a friend in an editor window, the text you enter is stored in the computer’s memory. Your letter is typically referred to as a document. If you quit the program without first saving your document to a file on your computer’s disk, the information is lost. When you save your document to a file, you can later open it and continue editing it where you left off the last time you saved it.

In this chapter, you will learn to work with files from within an application: how to open and save files and how to save different copies of a file. This chapter also serves as an introduction on how to use a prototypical application such as the editor provided by KDE, KEdit. (KEdit is a simple text editor bundled with KDE.)

Creating and Saving Files

All KDE applications use similar menus and commands to save and open files. If the application you are using is not part of KDE or is not designed for the KDE environment, the interface will be a little different. Overall, however, it should be analogous to a KDE application, and you should be able to find your way around it.

Creating a New File

Typically, when you want to create a new file, you open an application and begin working. Usually, applications will start with an empty file (sometimes this is a document, but not always). If the application is already running, you might need to create a new document window, by either running a new instance of the application or using the application’s New command. Typically, this command under KDE will be found under the File menu. Some applications allow you to work on multiple documents at the same time; some will allow you to edit only one document at a time. If your application only supports a single document at a time, you can bypass this limitation by launching another copy of the application. In the following figure you’ll see KEdit (a text editor).


Creating a new file is as easy as choosing a menu command

Features of this window include:

  The File menu, which provides commands for dealing with a document and the application such as New for creating new files, Open to open an existing file, Save to save a file, Close to close the document, and Exit to exit the application.
  Choose New to create a new document. If you would like to work on several documents at the same time, you can use the New Window command or start another instance of the application.
  The KEdit icon is the 2nd icon from the right (pencil with the green cover): To start KEdit, click its icon on the panel.
  The title of an unsaved window is Untitled.

When you save your work in an application, it is stored in a file so that you can later read it or modify it. When you save a file for the first time, you give the file a name.

If you close the document window without saving your work, your work is lost because you did not save it to disk. Well-behaved programs will ask you to save your documents into a file before you exit them or before you close an unsaved window. Some not-so-well-behaved programs will readily discard your work without any warning. Stay away from programs that exhibit such behaviors.

Opening an Existing File

To open an existing file, you can use the Open command from the File menu (see the following figure). The Open command will present a panel that allows you to select a document to work with. You can use this panel to navigate through your folders (directories) until you find the document you want to edit.


The Open panel lets you open an existing file for viewing, editing, and, in some cases, just selecting the file.

Instead of using the user interface controls to move between directories, sometimes it might be easier and faster to type the name of the path and name of the file in the Location field.

When you click on a file, the Open panel will disappear, and the document will load into the application.

Customizing the Open Panel

There are many options available to the Open panel that you can use to configure the way that files are displayed. To change your configuration, select the Configure button (see the previous figure).


You can customize many elements of the Open panel in this dialog box.

Open Panel Setting Customizations

Most of the customization settings are self-explanatory. My favorite customizations are to mix directories and files (see the following figure) and to uncheck the single click to open a file or directory. (Double-clicking to open reduces to possibility of opening the wrong file with a single click.)


The Open panel’s display showing mixed directories and files.

Saving a New File

When you save a document for the first time, you create a file. As part of the process, you’ll need to give the file a name. Documents are saved into files using the Save or Save As commands available under an application’s File menu. Choosing the Save As command will prompt you for a name and a place to save your document. After your document is saved, using the Save command will update the contents of the file with any new changes you have made. If your file has not yet been saved, the Save command will behave the same as the Save As command: It will prompt you for a filename.


The Save As panel lets you name your file

Features of this panel include:

  Shortcuts to move around files and directories similar to the Open panel buttons
  In the Folders window, select the folder where you want to put the file
  In Location space, type a name for the file

Click OK to save the file.

When you save your file, your work is saved to disk in the directory you specify. The document’s title bar will change from Untitled to display the name and path where the file is stored (see the next figure).


The title bar of a saved document displays its filename.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.