► |  | Dr Scheme: PLT Programming Environment

1 | Interface Essentials
2 | Languages
3 | Interface Reference
4 | Extending Dr Scheme
| Index

▼ | 3 | Interface Reference

3.1 | Menus
3.2 | Preferences
3.3 | Keyboard Shortcuts
3.4 | Dr Scheme Files

► | 3.4 | Dr Scheme Files

3.4.1 | Program Files
3.4.2 | Backup and Autosave Files
3.4.3 | Preference Files

On this page:

3.4.1`` Program Files
3.4.2`` Backup and Autosave Files
3.4.3`` Preference Files

top← prev up next →

#### 3.4`` DrScheme Files

##### 3.4.1`` Program Files

The standard file extension for a PLT Scheme program file is ".ss". The extensions ".scm" and ".sch" are also popular.

DrScheme’s editor can save a program file in two different formats:

- Plain-text file format – All text editors can read this format. DrScheme saves a program in plain-text format by default, unless the program contains images or text boxes. (Plain-text format does not preserve images or text boxes.)

  Plain-text format is platform-specific because different platforms have different newline conventions. However, most tools for moving files across platforms support a “text” transfer mode that adjusts newlines correctly.

- Multimedia file format – This format is specific to DrScheme, and no other editor recognizes it. DrScheme saves a program in multimedia format by default when the program contains images, text boxes, or formatted text.

  Multimedia format is platform-independent, and it uses an ASCII encoding (so that different ways of transferring the file are unlikely to corrupt the file).

##### 3.4.2`` Backup and Autosave Files

When you modify an existing file in DrScheme and save it, DrScheme copies the old version of the file to a special backup file if no backup file exists. The backup file is saved in the same directory as the original file, and the backup file’s name is generated from the original file’s name:

- Under Unix and Mac OS X, a "~" is added to the end of the file’s name.

- Under Windows, the file’s extension is replaced with ".bak".

Every five minutes, DrScheme checks each open file. If any file is modified and not saved, DrScheme saves the file to a special autosave file (just in case there is a power failure or some other catastrophic error). If the file is later saved, or if the user exists DrScheme without saving the file, the autosave file is removed. The autosave file is saved in the same directory as the original file, and the autosave file’s name is generated from the original file’s name:

- Under Unix and Mac OS X, a "#" is added to the start and end of the file’s name, then a number is added after the ending "#", and then one more "#" is appended after the number. The number is selected to make the autosave filename unique.

- Under Windows, the file’s extension is replaced with a number to make the autosave filename unique.

If the definitions window is modified and there is no current file, then an autosave file is written to the user’s “documents” directory.

> > > The “documents” directory is determined by (find-system-path 'doc-dir).

##### 3.4.3`` Preference Files

On start-up, DrScheme reads configuration information from a preferences file. The name and location of the preferences file depends on the platform and user:

> > > The expression (find-system-path 'pref-file) returns the platform- and user-specific preference file path.

- Under Unix, preferences are stored in a ".plt-scheme" subdirectory in the user’s home directory, in a file "plt-prefs.ss".

- Under Windows, preferences are stored in a file "plt-prefs.ss" in a sub-directory "PLT Scheme" in the user’s application-data folder as specified by the Windows registry; the application-data folder is usually "Application Data" in the user’s profile directory, and that directory is usually hidden in the Windows GUI.

- Under Mac OS X, preferences are stored in "org.plt-scheme.prefs.ss" in the user’s preferences folder.

A lock file is used while modifying the preferences file, and it is created in the same directory as the preferences file. Under Windows, the lock file is named "_LOCKplt-prefs.ss"; under Unix, it is ".LOCK.plt-prefs.ss"; under Mac OS X, it is ".LOCK.org.plt-scheme.prefs.ss".

If the user-specific preferences file does not exist, and the file "plt-prefs.ss" in the "defaults" collection does exist, then it is used for the initial preference settings. (See Libraries and Collections for more information about collections.) This file thus allows site-specific configuration for preference defaults. To set up such a configuration, start DrScheme and configure the preferences to your liking. Then, exit DrScheme and copy your preferences file into the "defaults" collection as "plt-prefs.ss". Afterward, users who have no preference settings already will get the preference settings that you chose.

top← prev up next →