Ferret File System/v0.1/process: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(scanning a volume, take 1)
 
(imperative tense; more instructions)
Line 1: Line 1:
==Scanning a Volume==
==Scanning a Volume==
When given a volume to scan, here's what happens:
When given a {{l/fileferret/sql|volume}} to scan, here's what happens:
* FF reads the directory at the volume's URL
* For every {{l/fileferret/sql|entry}} record in that volume:
* For each item found, does "Each Entry" below.
** Clear the "didFind" flag. (These get set as entries are found during the scan.)
** Set the "didSeek" flag. (Indicates entries that existed before this scan.)
* Read the directory at the volume's URL.
* For each item found, do "Each Entry" below. (This maps the volume.)
===Each Entry===
===Each Entry===
* Looks for a matching entry in {{l/fileferret/sql|dirent}}.
* Look for a matching {{l/fileferret/sql|entry}}.
* If entry does not exist, creates it.
* If entry does not exist, create it.
* Logs that the entry was found, and whether it was new or existing.
* Log that the entry was found, and whether it was new or existing.
* If it was an existing entry, logs any changes in the specs.
* If it was an existing entry, log any changes in the specs (timestamps, size).
* If Entry is a File, does "Each File" below.
* If Entry is a File, do "Each File" below.
* If Entry is a Folder, does "Each Folder" below.
* If Entry is a Folder, do "Each Folder" below.
===Each File===
===Each File===
* Checks the {{l/fileferret/sql|firev}} to see if it matches.
* Check the {{l/fileferret/sql|firev}} to see if it matches.
** If not, creates a new firev and updates the file's ID_Firev.
** If not, create a new firev and updates the file's ID_Firev.
** Logs whether the firev has changed or not.
** Log whether the firev has changed or not.
===Each Folder===
===Each Folder===
* Checks to see if folder is scannable.
* If folder is new:
** If it isn't, log that it was not scanned.
** Check name against text blacklist.
** If it is, do "Each Entry" above for each entry in the folder's directory.
** If found:
*** Mark it "noScan" when creating.
*** Add a note which includes the matching blacklist line.
* If "noScan" is set:
** log that it was not scanned ("noScan" is currently the only possible reason for this).
* ...else...
** do "Each Entry" above for each entry in the folder's directory.

Revision as of 23:23, 27 February 2016

Scanning a Volume

When given a volume to scan, here's what happens:

  • For every entry record in that volume:
    • Clear the "didFind" flag. (These get set as entries are found during the scan.)
    • Set the "didSeek" flag. (Indicates entries that existed before this scan.)
  • Read the directory at the volume's URL.
  • For each item found, do "Each Entry" below. (This maps the volume.)

Each Entry

  • Look for a matching entry.
  • If entry does not exist, create it.
  • Log that the entry was found, and whether it was new or existing.
  • If it was an existing entry, log any changes in the specs (timestamps, size).
  • If Entry is a File, do "Each File" below.
  • If Entry is a Folder, do "Each Folder" below.

Each File

  • Check the firev to see if it matches.
    • If not, create a new firev and updates the file's ID_Firev.
    • Log whether the firev has changed or not.

Each Folder

  • If folder is new:
    • Check name against text blacklist.
    • If found:
      • Mark it "noScan" when creating.
      • Add a note which includes the matching blacklist line.
  • If "noScan" is set:
    • log that it was not scanned ("noScan" is currently the only possible reason for this).
  • ...else...
    • do "Each Entry" above for each entry in the folder's directory.