Tailoring TempDir.
------------------
TempDir can be tailored to act in slight different ways.
You can do this by editing the variables in the MySettings file in !Tempdir.


1. TempDir name and location
=============================
Setmacro TempDir$ <root$path>.^.Tempdir
This sets where the Tempdir root directory and all the dated directories
will be stored. By default this is in the same place where you store your
!Boot application.
You can even rename the TempDir directory if you wish.


2. Age of Directories
=====================
Set tempdir%days 40
This sets how many days your dated directories can live for before they are
deleted.
Note: RISC OS 3 can only hold up to 77 directories.
Note: To make TempDir never delete a directory make this value 0 (zero) or
very large.


3. Opening Directories
======================
Set TempDirOpenall 0
Normally if you click on the TempDir icon on the Icon Bar then todays
directory will open and come to the front. Clicking with ADJUST causes
the directory to close.

However, if you alter this variable to read 'Set TempDirOpenall 1' then the
ADJUST button will toggle open or close *all* the dated directories instead.
This was a requested feature.


4. Fancy Dates
==============
Set tempdir$fancydates On
As supplied this is left on as it allows you to alter the way the directories
which are created to be labeled.

If you set it to 'Set tempdir$fancydates Off' then all directories created
will be named in the format DD/MM/YYYY (this is for historical reasons).
There is really no reason now to turn it off!


5. Date Format
==============
Set tempdir$dateformat %DY%M3%YR
This variable is only used when the fancy dates ability is turned on.
It allows you to alter the way the dated directories are created.
If you've never seen these '%DY%M3%YR' characters before, then I'll need to explain them. :-)
They are used to arrange the way RISC OS treats the date and time output
and are most often seen in the application !Alarm.

Full detail of these characters are in your Computer User guide in the !Alarm
chapter. But I'll go over them here briefly.

%DY means Day of the month. eg. 01, 02, etc.
%M3 means Month name (short) eg Jan, Feb, etc.
%YR means Year within century er 19, 20, etc.

Basically they consist of a percentage sign followed by two uppercase letters.
And you can put any other text (subject to the usual restrictions of characters
which are allowed to be placed in a filename) in there too.
eg. %DY=%M3-(%YR) would produce 27=Sep-(99).

So the first example in this section produces the date as '27Sep98'.
If I was to use %CE%YR%M3%DY I would get out '1998Sep27' as %CE means Century.

As you can imagine this allows a wide range of different ways you can date a
directory for your use.

One example might be %CE%YR%MN%DY which would produce '19980927' which by
the way is the latest ISO standard (ISO8601) way to display a date!

Perhaps you need the day of the week?
%WE gives this.
So 'Set tempdir$dateformat %WE' would just give you a directory called 'Sunday'.

As you can imagine an interesting prospect opens up here. There are only 7
days of the week so by using the above example TempDir can only produce 7
different directories so effectively you've made a temporary directory for
every day of the week. So as time passes you'll only ever have 7
temporary directories.

(Note though that the directory will *still* age over time, but if you want to
keep them and their contents forever then simply alter the value in
'tempdir%days' to 0 or make it pretty big : 9999?).

Of course the possibility arises that you may want to create a directory once
a month instead?
Use 'Set tempdir$dateformat %MO' and each directory will be named after the
current month.

Perhaps you need the Week number in the date for business reasons?
Use 'Set tempdir$dateformat %MO-%WK' to give you 'Sunday-39'

Drawbacks?
----------
The main problem with using these is ensuring that you don't accidentally make
!Tempdir create a directory with a filename longer than ten characters as
RISC OS 3 only supports a maximum of 10 unless you've added a third party
utility (like Longfiles, RaFS, X-files, etc.) to allow you to expand on this.
Of course if you've got RISC OS 4 and are using one of its new disc formats
then you're fine.

Another wee problem is that filenames can't have spaces in them, but you can get
around this by pressing <ALT><SPACEBAR> instead of the Spacebar.
These 'Spaces' look like original Spaces but act like a blank letter.
These are called 'Hard Spaces'.

So 'Set tempdir$dateformat %W3 %DY%ST' will produce 'Sun 27th' as I've used a
<ALT><SPACE> between %W3 and %DY instead!


The full list of Time Format fields you can use in TempDir.
-----------------------------------------------------------
WE	Weekday - full		Thursday
W3	Weekday - short		Thu
WN	Weekday number		5
DY	Day of the month	01
ST	Ordinal pre/suffix	st nd rd th
MO	Month name - full	September
M3	Month name - short	Sep
MN	Month number		09
CE	Century			19
YR	Year within century	99
WK	Week of year		52
DN	Day of the year		364
TZ	Timezone		BST GMT


6. Forced deletion
==================
It is possible to place in a TempDir directory locked files or directories.
So when the time comes for TempDir to delete a dated directory it can't as it
still has locked files in it.

From V1.34 I've been asked to add the option to override this security feature
and so if you want all the files deleted when the expiry time comes, set this
option to ON otherwise leave it off.
As supplied TempDir will never delete locked files.

Set tempdir$forcedelete on
or
Set  tempdir$forcedelete off


 

7.  Debug
==========
Really only for inhouse use if you're having a problem then I may ask you to
turn this option on and send me the contents of the text file 'debug' which is
produced inside !TempDir.

ie make this line in your MySettings file :
Set tempdir$debug off
read
Set tempdir$debug on

The debug text file is made when !TempDir is ran.

If you do have a problem with TempDir then turn this option on and send me
the debug file (!tempDir.Debug) in the first instance.


8. SmartOpenDir
===============
NOTE THIS IS A 32BIT PROGRAM.
 
!TempDir is supplied with a copy of SmartOpenDir (SmartDir).
This very useful program by Tony Houghton allows the sorting order of the Filer
to change depending on what directory you open.
Read about it in !TempDir.SmartDir as by default its turned off in !TempDir.
If you want to turn it on see the MySettings file of !TempDir

It's quite handy!
Note: you will require the latest !System 32bit files to use this.
You can get these from http://www.iyonix.com/32bit/system.shtml


9. TempDirs Working Path
========================
Some people want to be able to use todays Tempdir path to store files from
other programs in.
For those people please use the system variable:

tempdirworkingpath

ie it will point to a directory.
for example : ADFS::HardDisc4.$.Tempdir.Saturday

See also system variable 'today' which TempDir also creates.


10. Confirm
========================
Some people like to have the OS Filer Confirm option on all the time,
but dislike the Confirm box appearing when dragging files to the TempDir icon
on the IconBar.
By setting the tempdir$confirm variable to OFF this will surpress the Filer
Confirm box when dragging files to TempDirs icon on the Iconbar.

Set tempdir$confirm Off
Set tempdir$confirm On

11. 'today'.
=================
The System varible called 'today' always points to Tempdirs current directory.
Useful in placing this name in any 'Save as:' dialogue box to allow quick and
easy saving of files without dragging them any where.
ie today:work1 would save the file 'work1' to the TempDir directory.
Note: a few applications don't like a path with no '.' (full stop) in it so 
this may not work with all 'Save as' dialogue boxes.


12. Close Filer windows when quit 
=================================
If the System variable 'tempdir$closefilerwhenquit' is set to 'On' then when
TempDir is stopped then all its Tempdir directories will be forced to close.

Set tempdir$closefilerwhenquit On
Set tempdir$closefilerwhenquit Off

If set to off then it won't do this.
(note: TempDir only reads this variable when it is first run).


End.



