home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / shareware / share_46 / objectlist / Manual < prev    next >
Text File  |  1992-06-21  |  16KB  |  433 lines

  1. ObjectLister v1.10 User Manual                            (Dated 21.06.92)
  2.  
  3. OBJECTives: 
  4.  
  5. 1) To provide extensions to the OS to create, sort, and process lists of 
  6.    directory and/or file 'objects'.
  7. 2) To do this in as flexible a way as possible. The command parameters
  8.    may look a bit daunting but you probably will not need all of them at
  9.    once - start off with simple requests and work up to complicated ones!
  10.  
  11. What use is that I hear you ask. Well there are various uses - here are 
  12. some ideas to get you thinking...
  13.  
  14. 1) Track down duplicate files - relocatable modules, for example, have
  15.    a habit of turning up all over the place if you're not careful.
  16. 2) Find out what files you worked on today, yesterday, last week,
  17.    last month...
  18. 3) Find out the sizes of the biggest files on your system.
  19. 4) Squash all your sprite files via !Compression with a few lines of an 
  20.    obey file.
  21. 5) Prepare data for charting your disk usage.
  22. 6) Keep track of any suspicious changes to files - eg modules increasing in 
  23.    length when you know they haven't been upgraded - a sign of possible 
  24.    viral attack.
  25. 7) Back up todays work.
  26.  
  27.  
  28. Important bits...
  29.  
  30. You will need to ensure that the shared C library (v3.50 or greater) has 
  31. been loaded before you attempt to load and use this module.
  32. Put a copy of this module in the !system.modules directory.
  33.  
  34.  
  35. General Stuff...
  36.  
  37. A list is composed of entries - one for each object. Each entry has seven 
  38. comma separated components (numbered 0-6).
  39. These are:-
  40.  
  41. 0) Object type 1= file, 2= RiscOS directory, 3 = PC 'Hard Disc'
  42. 1) Date part of objects datestamp, or 0 if not datestamped.
  43. 2) Time part of objects datestamp, or 0 if not datestamped.
  44. 3) Filetype of file objects; always 0 for others.
  45. 4) Size of object (in Hex).
  46. 5) Objects attributes (in Hex).
  47. 6) Object name.
  48.  
  49. Components 0-4 form a string of fixed length.
  50.  
  51. You may introduce comment lines into a list if you wish. They should 
  52. begin with the character |.
  53.  
  54. In the command descriptions below :-
  55. [] denote optional features - even where they are enclosed in quotes.
  56. | denotes a choice e.g  a|b  means a or b
  57. ... denotes a possible repetition
  58.  
  59. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. *OLmake    -    Make an object list
  61.  
  62. Syntax: 
  63. *OLmake -Path <directory> [-Ftype "[NOT] <n>|<string>..."] 
  64.   [-Match "[NOT]<string>..."] [-After <date/time>] [-Before <date/time>] 
  65.   [-Larger <n>] [-Smaller <n>] [-Recurse <n>] [-Locked y|n] [<options>]
  66.  
  67.  
  68.   -path <directory name>
  69. Required. Describes place to start.
  70.  
  71.  
  72.   -ftype "[Not] <x>|<string>..."
  73. Optional. Select all objects that have filetype x (or not - see below). 
  74. If a string is entered it is evaluated via OS_FSControl 31. 
  75. Examples of valid strings are: Text, Drawfile, Obey, Data etc.
  76. (see the File$Type_nnn system variables for the valid text for each
  77. filetype number)
  78. You may specify up to ten different filetypes by separating them with 
  79. spaces or commas and enclosing them all in quotes
  80. e.g 
  81. -ftype "Obey &FFF Data" will select obey files, text files, and data files.
  82.  
  83. You may reverse the selection process by prefixing the list with 'NOT'.
  84. e.g
  85. -ftype "not obey &FFF Data" will select everything but obey files, text 
  86. files, and data files.
  87.  
  88.  
  89.   -match "[Not] <string>..."
  90. Optional. Select all objects whose name matches with any of the given 
  91. patterns (or not - see below). 
  92. The string may contain the 'wildcard' characters # and * 
  93. (in fact it will in most cases). Note this matching occurs over the entire 
  94. object name and not just the leaf.
  95.  
  96. * acts as a 'wildcard' to match zero, or more, characters 
  97. # acts as a 'wildcard' to match any single character
  98.  
  99. Note that certain wildcard combinations are condensed prior to use:-
  100. ie ** = *
  101.    *# = *
  102.  
  103. You may enter more that one pattern to search for - they should be 
  104. separated by spaces and enclosed in quotes in the same way as multiple 
  105. filetypes (see above). The number of patterns is restricted only by the 
  106. length of the command line.
  107. You may reverse the selection process by prefixing the patterns with 
  108. 'NOT' (this word cannot be used as a pattern).
  109.  
  110.  
  111.   -after <date/time>
  112. Optional. Filter out any objects that are not younger than the moment 
  113. specified. See below for valid formats of the date/time string.
  114.  
  115.  
  116.   -before <date/time>
  117. Optional. Filter out any objects that are not older than the moment 
  118. specified. See below for valid formats of the date/time string.
  119.  
  120.  
  121. -after & -before can be used together in the same command.
  122.  
  123.  
  124.   -larger <n>
  125. Optional. Select all objects whose size > n
  126.  
  127.  
  128.   -smaller <n>
  129. Optional. Select all objects whose size < n
  130.  
  131.  
  132. -larger & -smaller can be used together in the same command.
  133.  
  134.  
  135.   -recurse <n>
  136. Optional flag. If present the list will contain objects from all of the 
  137. sub-directories of the -path given down to the nth level. If you want
  138. everything select a large enough value for n eg >128.
  139.  
  140.  
  141.   -locked y|n
  142. Optional. If specified will filter out those objects not in the required 
  143. lock state.
  144.  
  145.  
  146.   -x
  147. Optional flag. If present, and the path name given is in the form of a 
  148. system variable (eg <font$path>) this will be expanded before being 
  149. output to the list. This allows you to delay expansion until you want.
  150. This is handy if you move a group of objects to another place but keep
  151. their relative structure - you only need to change the contents of the 
  152. variable and you can use the same list (you could use the list to move
  153. the objects in the first place with a bit of tweeking).
  154.  
  155.  
  156.   -d
  157. Optional flag. If present directory objects will always be listed no matter
  158. what other filters are in effect. 
  159. eg  *OLmake $ -f text -r 256 -d
  160. will list all text files on the current filing system along with all the 
  161. directories. If -d were not present no directories would be listed since 
  162. they don't have a filetype. A list of only directories can be obtained by
  163. selecting an impossible filetype along with this flag
  164. eg *Olmake $ -f &FFFF -d
  165.  
  166.  
  167. Useful Info for *Olmake
  168.  
  169. 1) Use RISCOS file redirection to send the output to a data file.
  170.    eg *OLmake $ { > RAM:$.list1 } 
  171.    will output details of the current root  directory to a file named list1
  172.    in the root directory of the ram disc.
  173.  
  174. 2) The date/time strings should be entered in one of the following 
  175.    formats :-
  176.  
  177.        i)  ccyy/mm/dd.hh:mm:ss
  178.       ii)  yy/mm/dd.hh:mm:ss
  179.      iii)  ccyy/mm/dd
  180.       iv)  yy/mm/dd
  181.        v)  hh:mm:ss
  182.       vi)  "now"
  183.      vii)  "today"
  184.     viii)  "this morning"
  185.       ix)  "this afternoon"
  186.        x)  "first sec"
  187.  
  188.    You may substitute the following two letter combinations into the 
  189.    string for formats i) thru v) - these will be replaced from the current 
  190.    date/time values AT THE TIME THE COMMAND WAS ISSUED :- 
  191.  
  192.        i) cc = current century
  193.       ii) yy = Current year
  194.      iii) mm = Current month if in date; or current minute if in time
  195.       iv) hh = Current hour (24 hour clock)
  196.        v) ss = Current second
  197.  
  198.    Formats vii) to ix) will substitute different values depending on the
  199.    context in which they are being used e.g.
  200.    -Before "this morning" will evaluate to -Before ccyy/mm/dd.00:00:00
  201.    -After "this morning" will evaluate to -After ccyy/mm/dd.11:59:59
  202.    
  203.    Format x) will substitute the time 0000/00/00.00:00:01 and its main
  204.    use is in distinguishing non-typed files which are given a date/time
  205.    of zero.
  206.  
  207. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208.  
  209. *OLcompare    -    Compare two object lists and output a third
  210.  
  211. Syntax: 
  212. *OLcompare -List1 <filename> -Operation <opcode> -List2 <filename> 
  213. [<options>]
  214.  
  215.  
  216.   -List1 <file name>
  217. Required. Identity of primary file
  218.  
  219.  
  220.   -List2 <file name>
  221. Required. Identity of secondary file.
  222.  
  223.  
  224.   -Action <action>
  225. Required. Notes the comparison action to be taken. This can be one of:-
  226. EQual   - Select entries which match in both files.
  227. NOt     - Select entries that have no match in the other file.
  228. MErge   - Combine the entries from both files dropping duplicates.
  229. DAte    - Select entries from list 1 that have a different datestamp from 
  230.           their counterparts in list2.
  231. YOunger - Select entries from list 1 that are younger than their 
  232.           counterparts in list2.
  233. OLder   - Select entries from list 1 that are older than their counterparts            in list2.
  234. SIze    - Select entries from list 1 that have a different size from 
  235.           their counterparts in list2.
  236. SMaller - Select entries from list 1 that are smaller than their 
  237.           counterparts in list2.
  238. LArger  - Select entries from list 1 that are larger than their counterparts           in list2.
  239. NEwer   - Select entries from list 1 that have changed from their 
  240.           namesakes in list2 - no checking is done on object type, 
  241.           filetype, or size.
  242. (the capital letters denote the minimum letters required by the command.)
  243.  
  244.  
  245.   -x
  246. Optional flag. If present, and the path name given is in the form of a 
  247. system variable (eg <font$path>) then it is expanded BEFORE 
  248. comparison of the name strings takes place. (see above description of
  249. OLMAKE).
  250.  
  251.  
  252. Useful Info for *Olcompare
  253.  
  254. 1) Use RiscOS file redirection to create lists as for *Olmake above.
  255.  
  256. 2) It is vital that you do not change the order of the lists in any way 
  257.    from when they were output by OLmake - you can put comment lines in
  258.    however. 
  259.  
  260.  
  261. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  262.  
  263. *OLprocess    -    Generate strings from object list data
  264.  
  265. Syntax:
  266. *OLprocess -List <objectlist> -Template \"<string>\" 
  267. [-Obeyfile <filename>] [-Ftype <n>] [<options>]
  268.  
  269.  
  270.   -List <objectlist name>
  271. Required. Denotes the objectlist to use in the command.
  272.  
  273.  
  274.   -Template <string>
  275. Required. Gives the template to use when constructing strings. 
  276. It should contain at least one substitution marker to be useful. 
  277. Substitution markers are introduced into the template by the 
  278. percentage sign %.
  279. Currently these markers can be any of :-
  280. %o   Full object name. 
  281.          e.g. adfs::HardDisc4.$.!Impression.Docs.MyLetter
  282.  
  283. %p   Path name excluding system portion. 
  284.          e.g. $.!Impression.Docs
  285.  
  286. %l   Object 'leaf' name e.g. MyLetter
  287.  
  288. %s   System name with end colon e.g. adfs:
  289.  
  290. %m   Media name e.g. HardDisc4
  291.  
  292. %d   Provides an account of the current subdirectory depth.
  293.          
  294. %c   A general purpose incremental line counter. Set to zero at start.
  295.  
  296. %,n^ Entry component n.
  297.  
  298. %.n^ The nth directory back up from the leaf. Stops at $.
  299.           e.g. In the example above %.1^ = Docs
  300.  
  301. %+   A means to add the percentage sign into the string.
  302. NOTE: %p, %s, %m, %d or %.n^ will force the -x flag on.
  303.  
  304.  
  305.   -Obeyfile <file name>
  306. Optional. The generated strings will be output to an obey file using 
  307. the name given.
  308.  
  309.  
  310.   -Ftype <x> | <string>
  311. Optional. Selection behaviour is identical to the corresponding parameter in *Olmake (see above).
  312.  
  313.  
  314.   -d
  315. Optional. Always include directory objects (overrides any other settings 
  316. which might act to filter out directory names eg -Filetype).
  317.  
  318.  
  319.   -x
  320. Optional flag. If present, and the path name in the list data is given in 
  321. the form of a system variable (eg <font$path>) then it is expanded 
  322. BEFORE being output into the string. (see above description of 
  323. OLMAKE).
  324.  
  325.  
  326. Useful Info for *Olprocess
  327.  
  328. 1) This command carries a health warning! Be careful when using it
  329.    with destructive commands like *Delete, *Remove etc. that you
  330.    have made the right selection.
  331. 2) As well as creating * command strings this command can be used
  332.    to reformat an object list, or to extract data from it, eg object size.
  333.    Thus this provides a way of preparing system info to input into 
  334.    databases/spreadsheets and mucked about with to your hearts desire !
  335.    (assuming you can't import the lists 'as is')
  336.  
  337.  
  338. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. Notes on v1.01:
  340.  
  341. 1) PC emulator users who have set up PC 'Discs' will find that,
  342.    sadly, these just show up as directories - no pc files will be listed.
  343.    Sorry ! - but the module makes use of SWI OS_GBPB 11 which doesn't
  344.    seem to work with PC directories. There must be a way since RiscOS 3 
  345.    gives the info on PC files just like any other - if anyone can tell me 
  346.    how it's done I would be very happy to add this.
  347.  
  348. 2) In order to conserve module memory allocation when recursing down
  349.    many directory levels a shrinking workspace strategy is employed.
  350.    If the directory level exceeds 9 the amount of workspace obtained to
  351.    store the directory object details is successively reduced at each level 
  352.    until a minimum value is reached. Hence, if you have a very deep 
  353.    directory structure, and the directories at the lowest levels are quite 
  354.    full, creating a list of the root directory onwards will take longer than
  355.    a listing of the same number of objects from a more shallow structure.
  356.  
  357.    Workspace allocation details: 
  358.     Normal level allocation is 1500 bytes
  359.     levels beyond level 9 are reduced by 40 bytes per level
  360.     until level allocation reaches 200 bytes.
  361.    Each object record can take up 40 bytes max so 37.5 object records 
  362.    can be stored in 1500 bytes. 37.5 is not far off half of 77 which is the 
  363.    maximum number of objects you can have in a RiscOS directory - I 
  364.    thought this middle-of-the-road figure was a good one to aim for.
  365.  
  366. 3) All the commands will update a system variable with a count of 
  367.    the number of lines output. The variable is called ObjList$Val.
  368.    This can be used as a quick check in Olmake/Olcompare to see 
  369.    if any objects conformed to the request.
  370.  
  371.  
  372. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  373. General Notes + License Agreement on Object Lister:
  374.  
  375. 1) This software is supplied 'As is' - it carries no warranty, either 
  376.    expressed or implied.
  377.    It is not guaranteed to be free of bugs - no warranty is given about 
  378.    its' suitability for use.
  379.  
  380. 2) This software is public domain. It may be distributed freely
  381.    provided it is copied whole - by this I mean :-
  382.      This manual file.
  383.      The Objectlister Relocatable Module.
  384.      The entire contents of the examples directory.
  385.      The change log file.
  386.  
  387. 3) User modified versions of the items mentioned in (2) must not be 
  388.    distributed under the same name - I don't mind taking the blame for
  389.    my own mistakes but I will not be a scapegoat for the mess of others !
  390.  
  391. 4) Feel free to write your own PD applications that use it.
  392.  
  393. 5) It may not be sold by itself for commercial gain of any nature. It may
  394.    be incorporated into commercial applications provided :-
  395.  
  396.      a) You ask my permission first.
  397.      b) The authorship is acknowledged.
  398.      c) You copy ALL of the software (see 2 above).
  399.      d) It is not copy protected in any way.
  400.      e) It is excluded from any end user license agreements applying to 
  401.         your application(s).
  402.      f) Some money is paid to a registered charity for each copy.
  403.  
  404. 6) In the pipeline...
  405.    I hope to write a desktop front end application for this module.
  406.    I may write a Backup application also - but don't hold your breath !
  407.    - perhaps someone else might like to try this ?
  408.  
  409. 7) Constructive criticisms/suggestions, bug reports, discs for latest 
  410.    versions, praise, or money should be sent to the following address 
  411.    (preferably with S.A.E if reply required):-
  412.  
  413.    91, Little Bushey Lane,
  414.    Bushey
  415.    WATFORD
  416.    Herts.
  417.    WD2 3SD
  418.  
  419.    No phone/house calls please !
  420.  
  421.    Sorry, snail mail only - I haven't go the hang of these comms 
  422.    contraptions yet (but i'm working on it)...
  423.  
  424.    Yours,
  425.  
  426.    Tony Fewell.
  427.  
  428.  
  429. P.S
  430.  
  431. I can supply this manual as an Impression document for those who want 
  432. it - just send a blank disc in a S.A.E to the above address. 
  433.