Home » Archimedes archive » Acorn User » AU 1997-06 B.adf » Extras » RiscUtils/!RuInstall/Install/!Help/Help/Text/Help/PC-NoClose

RiscUtils/!RuInstall/Install/!Help/Help/Text/Help/PC-NoClose

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-06 B.adf » Extras
Filename: RiscUtils/!RuInstall/Install/!Help/Help/Text/Help/PC-NoClose
Read OK:
File size: 089E bytes
Load address: 0000
Exec address: 0000
File contents
Prevent_Close_&_Shut_Commands_When_PCcard_Is_Running : This is one of my most useful components /programs, as the name suggests it prevents the *Shut and *Close commands from being carried out when the PC Card is running on the same machine. 

Why would you want to stop these commands from being carried out? The problem is this : If the user wants to get in to a PC partition from RISC OS, while running the PC card, he/she is told "Error when reading Drive_C - This file has been left open from a previous operation" (i.e. the PC card is using it). Then, thinking they were clever typed in *Shut or *Close at the command line, so as to get in. Once having done what they need to in the PC partition, they go back in to the PC card to find it's crashed, taking all the unsaved work with it. This happens because issuing the shut command effectivly removes the PC partition�s HardDisc which obviously causes problems when it starts looking for a harddisc that is no longer there. Of course the user can try and simply remember not to type in *Shut or *Close at the command line to get in to a partition, but it is often possible to forget that the PC card is running, or for the Icon Bar to be covered, and it sod's law that the time this does happen, is the time when there is/was lots of unsaved work open in the PC Card.

What this component does is re-route the *Shut and *Close commands, so that every time they are issued, the computer checks (using a modified version of If_Task -see the help file 'If_Task') to see if the PC card is running. If it isn�t a normal *Shut or *Close command (as appropriate) is carried out. But if it is, then a warning pops up, telling you not to issue the *Shut and *Close commands when the PC card is running, and the *Shut or *Close command is not actually carried out. Which means the PC card doesn�t crash, and your work is not lost.

To activate the component simply run 'RISCutils', with the 'Prevent_Close_&_Shut_Commands_When_PCcard_Is_Running' option in RISCutil's !Run file set to 'Y'. To de-activate it run the file RISCutils.User_Area.Files.Remove, and run 'RISCutils', with the 'Prevent_Close_&_Shut_Command_When_ PCcard_Is_Running' option set to 'N.'
00000000  0a 50 72 65 76 65 6e 74  5f 43 6c 6f 73 65 5f 26  |.Prevent_Close_&|
00000010  5f 53 68 75 74 5f 43 6f  6d 6d 61 6e 64 73 5f 57  |_Shut_Commands_W|
00000020  68 65 6e 5f 50 43 63 61  72 64 5f 49 73 5f 52 75  |hen_PCcard_Is_Ru|
00000030  6e 6e 69 6e 67 20 3a 20  54 68 69 73 20 69 73 20  |nning : This is |
00000040  6f 6e 65 20 6f 66 20 6d  79 20 6d 6f 73 74 20 75  |one of my most u|
00000050  73 65 66 75 6c 20 63 6f  6d 70 6f 6e 65 6e 74 73  |seful components|
00000060  20 2f 70 72 6f 67 72 61  6d 73 2c 20 61 73 20 74  | /programs, as t|
00000070  68 65 20 6e 61 6d 65 20  73 75 67 67 65 73 74 73  |he name suggests|
00000080  20 69 74 20 70 72 65 76  65 6e 74 73 20 74 68 65  | it prevents the|
00000090  20 2a 53 68 75 74 20 61  6e 64 20 2a 43 6c 6f 73  | *Shut and *Clos|
000000a0  65 20 63 6f 6d 6d 61 6e  64 73 20 66 72 6f 6d 20  |e commands from |
000000b0  62 65 69 6e 67 20 63 61  72 72 69 65 64 20 6f 75  |being carried ou|
000000c0  74 20 77 68 65 6e 20 74  68 65 20 50 43 20 43 61  |t when the PC Ca|
000000d0  72 64 20 69 73 20 72 75  6e 6e 69 6e 67 20 6f 6e  |rd is running on|
000000e0  20 74 68 65 20 73 61 6d  65 20 6d 61 63 68 69 6e  | the same machin|
000000f0  65 2e 20 0a 0a 57 68 79  20 77 6f 75 6c 64 20 79  |e. ..Why would y|
00000100  6f 75 20 77 61 6e 74 20  74 6f 20 73 74 6f 70 20  |ou want to stop |
00000110  74 68 65 73 65 20 63 6f  6d 6d 61 6e 64 73 20 66  |these commands f|
00000120  72 6f 6d 20 62 65 69 6e  67 20 63 61 72 72 69 65  |rom being carrie|
00000130  64 20 6f 75 74 3f 20 54  68 65 20 70 72 6f 62 6c  |d out? The probl|
00000140  65 6d 20 69 73 20 74 68  69 73 20 3a 20 49 66 20  |em is this : If |
00000150  74 68 65 20 75 73 65 72  20 77 61 6e 74 73 20 74  |the user wants t|
00000160  6f 20 67 65 74 20 69 6e  20 74 6f 20 61 20 50 43  |o get in to a PC|
00000170  20 70 61 72 74 69 74 69  6f 6e 20 66 72 6f 6d 20  | partition from |
00000180  52 49 53 43 20 4f 53 2c  20 77 68 69 6c 65 20 72  |RISC OS, while r|
00000190  75 6e 6e 69 6e 67 20 74  68 65 20 50 43 20 63 61  |unning the PC ca|
000001a0  72 64 2c 20 68 65 2f 73  68 65 20 69 73 20 74 6f  |rd, he/she is to|
000001b0  6c 64 20 22 45 72 72 6f  72 20 77 68 65 6e 20 72  |ld "Error when r|
000001c0  65 61 64 69 6e 67 20 44  72 69 76 65 5f 43 20 2d  |eading Drive_C -|
000001d0  20 54 68 69 73 20 66 69  6c 65 20 68 61 73 20 62  | This file has b|
000001e0  65 65 6e 20 6c 65 66 74  20 6f 70 65 6e 20 66 72  |een left open fr|
000001f0  6f 6d 20 61 20 70 72 65  76 69 6f 75 73 20 6f 70  |om a previous op|
00000200  65 72 61 74 69 6f 6e 22  20 28 69 2e 65 2e 20 74  |eration" (i.e. t|
00000210  68 65 20 50 43 20 63 61  72 64 20 69 73 20 75 73  |he PC card is us|
00000220  69 6e 67 20 69 74 29 2e  20 54 68 65 6e 2c 20 74  |ing it). Then, t|
00000230  68 69 6e 6b 69 6e 67 20  74 68 65 79 20 77 65 72  |hinking they wer|
00000240  65 20 63 6c 65 76 65 72  20 74 79 70 65 64 20 69  |e clever typed i|
00000250  6e 20 2a 53 68 75 74 20  6f 72 20 2a 43 6c 6f 73  |n *Shut or *Clos|
00000260  65 20 61 74 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |e at the command|
00000270  20 6c 69 6e 65 2c 20 73  6f 20 61 73 20 74 6f 20  | line, so as to |
00000280  67 65 74 20 69 6e 2e 20  4f 6e 63 65 20 68 61 76  |get in. Once hav|
00000290  69 6e 67 20 64 6f 6e 65  20 77 68 61 74 20 74 68  |ing done what th|
000002a0  65 79 20 6e 65 65 64 20  74 6f 20 69 6e 20 74 68  |ey need to in th|
000002b0  65 20 50 43 20 70 61 72  74 69 74 69 6f 6e 2c 20  |e PC partition, |
000002c0  74 68 65 79 20 67 6f 20  62 61 63 6b 20 69 6e 20  |they go back in |
000002d0  74 6f 20 74 68 65 20 50  43 20 63 61 72 64 20 74  |to the PC card t|
000002e0  6f 20 66 69 6e 64 20 69  74 27 73 20 63 72 61 73  |o find it's cras|
000002f0  68 65 64 2c 20 74 61 6b  69 6e 67 20 61 6c 6c 20  |hed, taking all |
00000300  74 68 65 20 75 6e 73 61  76 65 64 20 77 6f 72 6b  |the unsaved work|
00000310  20 77 69 74 68 20 69 74  2e 20 54 68 69 73 20 68  | with it. This h|
00000320  61 70 70 65 6e 73 20 62  65 63 61 75 73 65 20 69  |appens because i|
00000330  73 73 75 69 6e 67 20 74  68 65 20 73 68 75 74 20  |ssuing the shut |
00000340  63 6f 6d 6d 61 6e 64 20  65 66 66 65 63 74 69 76  |command effectiv|
00000350  6c 79 20 72 65 6d 6f 76  65 73 20 74 68 65 20 50  |ly removes the P|
00000360  43 20 70 61 72 74 69 74  69 6f 6e 91 73 20 48 61  |C partition.s Ha|
00000370  72 64 44 69 73 63 20 77  68 69 63 68 20 6f 62 76  |rdDisc which obv|
00000380  69 6f 75 73 6c 79 20 63  61 75 73 65 73 20 70 72  |iously causes pr|
00000390  6f 62 6c 65 6d 73 20 77  68 65 6e 20 69 74 20 73  |oblems when it s|
000003a0  74 61 72 74 73 20 6c 6f  6f 6b 69 6e 67 20 66 6f  |tarts looking fo|
000003b0  72 20 61 20 68 61 72 64  64 69 73 63 20 74 68 61  |r a harddisc tha|
000003c0  74 20 69 73 20 6e 6f 20  6c 6f 6e 67 65 72 20 74  |t is no longer t|
000003d0  68 65 72 65 2e 20 4f 66  20 63 6f 75 72 73 65 20  |here. Of course |
000003e0  74 68 65 20 75 73 65 72  20 63 61 6e 20 74 72 79  |the user can try|
000003f0  20 61 6e 64 20 73 69 6d  70 6c 79 20 72 65 6d 65  | and simply reme|
00000400  6d 62 65 72 20 6e 6f 74  20 74 6f 20 74 79 70 65  |mber not to type|
00000410  20 69 6e 20 2a 53 68 75  74 20 6f 72 20 2a 43 6c  | in *Shut or *Cl|
00000420  6f 73 65 20 61 74 20 74  68 65 20 63 6f 6d 6d 61  |ose at the comma|
00000430  6e 64 20 6c 69 6e 65 20  74 6f 20 67 65 74 20 69  |nd line to get i|
00000440  6e 20 74 6f 20 61 20 70  61 72 74 69 74 69 6f 6e  |n to a partition|
00000450  2c 20 62 75 74 20 69 74  20 69 73 20 6f 66 74 65  |, but it is ofte|
00000460  6e 20 70 6f 73 73 69 62  6c 65 20 74 6f 20 66 6f  |n possible to fo|
00000470  72 67 65 74 20 74 68 61  74 20 74 68 65 20 50 43  |rget that the PC|
00000480  20 63 61 72 64 20 69 73  20 72 75 6e 6e 69 6e 67  | card is running|
00000490  2c 20 6f 72 20 66 6f 72  20 74 68 65 20 49 63 6f  |, or for the Ico|
000004a0  6e 20 42 61 72 20 74 6f  20 62 65 20 63 6f 76 65  |n Bar to be cove|
000004b0  72 65 64 2c 20 61 6e 64  20 69 74 20 73 6f 64 27  |red, and it sod'|
000004c0  73 20 6c 61 77 20 74 68  61 74 20 74 68 65 20 74  |s law that the t|
000004d0  69 6d 65 20 74 68 69 73  20 64 6f 65 73 20 68 61  |ime this does ha|
000004e0  70 70 65 6e 2c 20 69 73  20 74 68 65 20 74 69 6d  |ppen, is the tim|
000004f0  65 20 77 68 65 6e 20 74  68 65 72 65 20 69 73 2f  |e when there is/|
00000500  77 61 73 20 6c 6f 74 73  20 6f 66 20 75 6e 73 61  |was lots of unsa|
00000510  76 65 64 20 77 6f 72 6b  20 6f 70 65 6e 20 69 6e  |ved work open in|
00000520  20 74 68 65 20 50 43 20  43 61 72 64 2e 0a 0a 57  | the PC Card...W|
00000530  68 61 74 20 74 68 69 73  20 63 6f 6d 70 6f 6e 65  |hat this compone|
00000540  6e 74 20 64 6f 65 73 20  69 73 20 72 65 2d 72 6f  |nt does is re-ro|
00000550  75 74 65 20 74 68 65 20  2a 53 68 75 74 20 61 6e  |ute the *Shut an|
00000560  64 20 2a 43 6c 6f 73 65  20 63 6f 6d 6d 61 6e 64  |d *Close command|
00000570  73 2c 20 73 6f 20 74 68  61 74 20 65 76 65 72 79  |s, so that every|
00000580  20 74 69 6d 65 20 74 68  65 79 20 61 72 65 20 69  | time they are i|
00000590  73 73 75 65 64 2c 20 74  68 65 20 63 6f 6d 70 75  |ssued, the compu|
000005a0  74 65 72 20 63 68 65 63  6b 73 20 28 75 73 69 6e  |ter checks (usin|
000005b0  67 20 61 20 6d 6f 64 69  66 69 65 64 20 76 65 72  |g a modified ver|
000005c0  73 69 6f 6e 20 6f 66 20  49 66 5f 54 61 73 6b 20  |sion of If_Task |
000005d0  2d 73 65 65 20 74 68 65  20 68 65 6c 70 20 66 69  |-see the help fi|
000005e0  6c 65 20 27 49 66 5f 54  61 73 6b 27 29 20 74 6f  |le 'If_Task') to|
000005f0  20 73 65 65 20 69 66 20  74 68 65 20 50 43 20 63  | see if the PC c|
00000600  61 72 64 20 69 73 20 72  75 6e 6e 69 6e 67 2e 20  |ard is running. |
00000610  49 66 20 69 74 20 69 73  6e 91 74 20 61 20 6e 6f  |If it isn.t a no|
00000620  72 6d 61 6c 20 2a 53 68  75 74 20 6f 72 20 2a 43  |rmal *Shut or *C|
00000630  6c 6f 73 65 20 63 6f 6d  6d 61 6e 64 20 28 61 73  |lose command (as|
00000640  20 61 70 70 72 6f 70 72  69 61 74 65 29 20 69 73  | appropriate) is|
00000650  20 63 61 72 72 69 65 64  20 6f 75 74 2e 20 42 75  | carried out. Bu|
00000660  74 20 69 66 20 69 74 20  69 73 2c 20 74 68 65 6e  |t if it is, then|
00000670  20 61 20 77 61 72 6e 69  6e 67 20 70 6f 70 73 20  | a warning pops |
00000680  75 70 2c 20 74 65 6c 6c  69 6e 67 20 79 6f 75 20  |up, telling you |
00000690  6e 6f 74 20 74 6f 20 69  73 73 75 65 20 74 68 65  |not to issue the|
000006a0  20 2a 53 68 75 74 20 61  6e 64 20 2a 43 6c 6f 73  | *Shut and *Clos|
000006b0  65 20 63 6f 6d 6d 61 6e  64 73 20 77 68 65 6e 20  |e commands when |
000006c0  74 68 65 20 50 43 20 63  61 72 64 20 69 73 20 72  |the PC card is r|
000006d0  75 6e 6e 69 6e 67 2c 20  61 6e 64 20 74 68 65 20  |unning, and the |
000006e0  2a 53 68 75 74 20 6f 72  20 2a 43 6c 6f 73 65 20  |*Shut or *Close |
000006f0  63 6f 6d 6d 61 6e 64 20  69 73 20 6e 6f 74 20 61  |command is not a|
00000700  63 74 75 61 6c 6c 79 20  63 61 72 72 69 65 64 20  |ctually carried |
00000710  6f 75 74 2e 20 57 68 69  63 68 20 6d 65 61 6e 73  |out. Which means|
00000720  20 74 68 65 20 50 43 20  63 61 72 64 20 64 6f 65  | the PC card doe|
00000730  73 6e 91 74 20 63 72 61  73 68 2c 20 61 6e 64 20  |sn.t crash, and |
00000740  79 6f 75 72 20 77 6f 72  6b 20 69 73 20 6e 6f 74  |your work is not|
00000750  20 6c 6f 73 74 2e 0a 0a  54 6f 20 61 63 74 69 76  | lost...To activ|
00000760  61 74 65 20 74 68 65 20  63 6f 6d 70 6f 6e 65 6e  |ate the componen|
00000770  74 20 73 69 6d 70 6c 79  20 72 75 6e 20 27 52 49  |t simply run 'RI|
00000780  53 43 75 74 69 6c 73 27  2c 20 77 69 74 68 20 74  |SCutils', with t|
00000790  68 65 20 27 50 72 65 76  65 6e 74 5f 43 6c 6f 73  |he 'Prevent_Clos|
000007a0  65 5f 26 5f 53 68 75 74  5f 43 6f 6d 6d 61 6e 64  |e_&_Shut_Command|
000007b0  73 5f 57 68 65 6e 5f 50  43 63 61 72 64 5f 49 73  |s_When_PCcard_Is|
000007c0  5f 52 75 6e 6e 69 6e 67  27 20 6f 70 74 69 6f 6e  |_Running' option|
000007d0  20 69 6e 20 52 49 53 43  75 74 69 6c 27 73 20 21  | in RISCutil's !|
000007e0  52 75 6e 20 66 69 6c 65  20 73 65 74 20 74 6f 20  |Run file set to |
000007f0  27 59 27 2e 20 54 6f 20  64 65 2d 61 63 74 69 76  |'Y'. To de-activ|
00000800  61 74 65 20 69 74 20 72  75 6e 20 74 68 65 20 66  |ate it run the f|
00000810  69 6c 65 20 52 49 53 43  75 74 69 6c 73 2e 55 73  |ile RISCutils.Us|
00000820  65 72 5f 41 72 65 61 2e  46 69 6c 65 73 2e 52 65  |er_Area.Files.Re|
00000830  6d 6f 76 65 2c 20 61 6e  64 20 72 75 6e 20 27 52  |move, and run 'R|
00000840  49 53 43 75 74 69 6c 73  27 2c 20 77 69 74 68 20  |ISCutils', with |
00000850  74 68 65 20 27 50 72 65  76 65 6e 74 5f 43 6c 6f  |the 'Prevent_Clo|
00000860  73 65 5f 26 5f 53 68 75  74 5f 43 6f 6d 6d 61 6e  |se_&_Shut_Comman|
00000870  64 5f 57 68 65 6e 5f 20  50 43 63 61 72 64 5f 49  |d_When_ PCcard_I|
00000880  73 5f 52 75 6e 6e 69 6e  67 27 20 6f 70 74 69 6f  |s_Running' optio|
00000890  6e 20 73 65 74 20 74 6f  20 27 4e 2e 27 0a        |n set to 'N.'.|
0000089e