<commit_before>#lang scribble/doc
@(require "common.ss")

@title[#:tag "drscheme-files"]{DrScheme Files}

@; ----------------------------------------

@section[#:tag "drscheme-file-formats"]{Program Files}

The standard @as-index{file extension} for a PLT Scheme program file
is @indexed-file{.ss}. The extensions @indexed-file{.scm} and
@indexed-file{.sch} are also popular.

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

@itemize{

 @item{@deftech{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.}

 @item{@deftech{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).}

}

@; ----------------------------------------

@section[#:tag "drscheme-autosave-files"]{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:

@itemize{

 @item{Under Unix and Mac OS X, a @filepath{~} is added to the end of
       the file's name.}

 @item{Under Windows, the file's extension is replaced with
       @filepath{.bak}.}

}

When a file in an active DrScheme editor is modified but not saved,
DrScheme saves the file to a special autosave file after five minutes
(in case of a power failure or 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:

@itemize{

 @item{Under Unix and Mac OS X, a @filepath{#} is added to the start
       and end of the file's name, then a number is added after the
       ending @filepath{#}, and then one more @filepath{#} is appended
       after the number. The number is selected to make the autosave
       filename unique.}

 @item{Under Windows, the file's extension is replaced with a number
       to make the autosave filename unique.}

}

@; ----------------------------------------

@section{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:

@margin-note{The expression @scheme[(find-system-path 'pref-file)]
 returns the platform- and user-specific preference file path.}

@itemize[

 @item{Under Unix, preferences are stored in a
   @indexed-file{.plt-scheme} subdirectory in the user's home
   directory, in a file @indexed-file{plt-prefs.ss}.}
<commit_msg>document location of auto-save file for a file-less definitions window<commit_after>#lang scribble/doc
@(require "common.ss")

@title[#:tag "drscheme-files"]{DrScheme Files}

@; ----------------------------------------

@section[#:tag "drscheme-file-formats"]{Program Files}

The standard @as-index{file extension} for a PLT Scheme program file
is @indexed-file{.ss}. The extensions @indexed-file{.scm} and
@indexed-file{.sch} are also popular.

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

@itemize{

 @item{@deftech{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.}

 @item{@deftech{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).}

}

@; ----------------------------------------

@section[#:tag "drscheme-autosave-files"]{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:

@itemize{

 @item{Under Unix and Mac OS X, a @filepath{~} is added to the end of
       the file's name.}

 @item{Under Windows, the file's extension is replaced with
       @filepath{.bak}.}

}

When a file in an active DrScheme editor is modified but not saved,
DrScheme saves the file to a special autosave file after five minutes
(in case of a power failure or 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:

@itemize{

 @item{Under Unix and Mac OS X, a @filepath{#} is added to the start
       and end of the file's name, then a number is added after the
       ending @filepath{#}, and then one more @filepath{#} is appended
       after the number. The number is selected to make the autosave
       filename unique.}

 @item{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. @margin-note{The ``documents'' directory is determined by
@scheme[(find-system-path 'doc-dir)].}

@; ----------------------------------------

@section{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:

@margin-note{The expression @scheme[(find-system-path 'pref-file)]
 returns the platform- and user-specific preference file path.}

@itemize[

 @item{Under Unix, preferences are stored in a
   @indexed-file{.plt-scheme} subdirectory in the user's home
   directory, in a file @indexed-file{plt-prefs.ss}.}

{'fraction_non_alphanumeric': 0.10203516544372145, 'fraction_numerical': 0.0, 'mean_word_length': 3.23943661971831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5095444', 'n_tokens_mistral': 1946, 'n_tokens_neox': 1859, 'n_words': 944}