home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
misc
/
b138_1
/
!Mycop
/
!Help
next >
Wrap
Text File
|
1993-11-19
|
7KB
|
173 lines
another one in the series 'going into the 2nd dimension'
!Mycop is a Mülleimer which is a bin
it works like many other trashcans: to 'delete' an object drop it onto
the bin. if it's nice the object will be stored away in !Mycop.Bin
if it's not nice you must be knowing what you're doing
(now that i've come to think about it: only !Trash by Richard K.Lloyd
is configurable this way, other bins seem to be nice only)
bin's current niceness is reflected by the LED in the upper right corner
of the icon: when the LED is red, the bin is deadly
(at least this is so with my sprites ...)
also, when you click SELECT on it to start a bulk delete you can tell
straight away whether it's nice or less
you can see if a nice bin is not empty
a deadly bin is always empty, so when you make a non-empty nice bin
deadly (see below) the icon changes also
unlike all the other bins !Mycop has no iconbar icon but sits on the screen
where you've put it. you move it around with the ADJUST button since
SELECT is used for:
1) bulk deletes
if you want to get rid of everything in a filer window, you can
'select all' from filer's menu and drag the selection to the bin.
easier and faster: click SELECT over the bin - the pointer changes
into a thing that'll reflect current bin state. drag the thing to your
window and release the button
2) opening !Mycop.Bin
hold down ⇧Shift and click SELECT over the bin - if the bin's nice
the directory things are stored away in opens up. nothing will happen
if the bin is not nice
to move !Mycop around in its current position in the windows stack
you drag it with ADJUST held down. if you want to bring it to the top of
the stack hold down Ctrl while ADJUSTing. it goes to the bottom instead
if you're ⇧Shift+ADJUSTing. a crib: left hand Ctrl is on top of ⇧Shift
clicking ADJUST changes the pointer to a hand. if you just want to bring
a partially obscured bin to the top but not move it otherwise, move the
pointer away from it to restore the default pointer. MENUing will also
restore the default pointer
the 'main' menu:
Mycop
-------
Info ⇨
Empty empties the bin if there's something in it
State ⇨
Quit
Empty will be grey if the bin is empty or not nice
the State submenu:
State
----------
Nice bin will be €ed if the bin's nice
Delete ⇨
Save saves current state
the state of the bin comprises its niceness, position on screen and
the settings of the 'Delete' submenu. the state is saved in !Mycop.State
if this does not exist, a nice bin keen on @ and open files (see below)
is placed somewhere on the screen on startup (btw why would a sane woman
need > 1 bin on his desktop?)
Delete
-----------
Current Dir
Current Lib
Open files
'€ Current Dir' means: if one of the objects the bin is considering to bin
is the Currently Selected Directory (@) on that object's filing system,
don't give the 'Can't delete current directory' error but kill the object
gracefully
'€ Current Lib' : above, replace CSD by 'Currently Selected Library' (%)
'€ Open files' : similar for open files
if you unset an option you don't get the default filer error box back,
the object in question just won't be deleted
inconsistencies
===============
there are 2 of them
they're a consequence of the way the binning process is implemented and
crop up only when the bin is nice and you're binning a directory with an
open file in it
some remarks about how the binning process is implemented
:
when you drop a selection onto !Mycop it appears to me as if i'm dealing
with just ONE object so it's easy to find out whether it's a dir, a file,
the @ or the %
:
when you go the other way i get a SET (directory) of objects each of which
must be isolated for 'comparing' with the options
:
so, if necessary, i do a ONE LEVEL scan first
:
now, if the object that's going to be binned is on the same filing system
as the !Mycop application directory then it (the object) will be RENAMEd
into !Mycop.Bin.object; if it's on a different FS it will be recursively
COPYed and the original'll be destroyed
--
(reminder: we're talking about nicely binning an object
there aren't any inconsistencies when the bin is not nice)
inconsistency #1
----------------
!Mycop detects open files by intercepting the 'file open' error which
does NOT work when RENAMEing a directory with an open file in it - this
slips through and you don't get the error. So you can end up with a
directory being 'deleted' inspite it contained an open file and the
'Delete.Open files' option was NOT set
inconsistency #2
----------------
the second inconsistency manifests itself when ObjectFS <> MycopFS and
again you do NOT want to 'Delete.Open files' but are binning a directory
with an open file in it. !Mycop identified the directory as the object
to act upon and executes a COPY ... rfd on it. Some way through the dir COPY
detects an open file an exits with the 'file open' error and the file is
let alone. You'd say, 'well, that's exactly what i wanted' but if the
directory contains objects 'behind' that open file they won't be deleted
this is a bit annoying but removing it would mean to search a directory
TREE for open files - i thought it's not worth it (not what you think,
i LOVE recursion, but it would slow the whole thing unnecessarily down)
besides, the reason i wrote !Mycop was that all the bins i know about
don't let you delete the @, the % or an open file, requiring you to quit
the error box, to go to the command line and to say NoDir, NoLib or Close,
possibly preceding each with the -RelevantFS-
so to me the above 'inconsistency examples' are purely academic -
i have all three Delete options set and saved
apropos save: don't forget that when you save a state, the current position
of !Mycop on the screen is saved as well, so the next time you run it
it appears where it was when you clicked on Mycop:State.Save the last time
finally, !Mycop recognizes attempts to kill a directory containing
a directory ... containing a directory containing !Mycop itself,
any objects inside it and any objects inside !Mycop.Bin and reacts
harsh - it does nothing.
finallyfinally: !Mycop starts the animation before it's sure that at least
one object is going to be deleted. So, if you feed it a @ but the
'Delete.Current Dir' option is unset, the animation could fool you of
something being deleted ... I had this working ok but i couldn't stand
the sight of 1000 IF's
last but not least: i borrowed (only big artists steal) the code to monitor
'any directory-changing activity' from Richard K.Lloyd's !Trash
i couldn't have done it myself anyway because Arthur does know nothing about
the UpCall 3
franz philipps
ehrm !Mycop was written on a 4mb machine so 32k is the smallest possible
WimpSlot but you'd surely get along with less