npFind plugin

About this plugin

This plugin can help you when need to find files and directories in HDD's, ever in various places at a time. The plugin can act very simple and very complex, because you can find for files, find for folders, find for both, find with file and dirs filemasks, dates, sizes, atttributes, and all together!

The plugin also have complete support for find events. You get information when a find is in progress or aborted, when the find engine begin find in a directory, when found a directory and when found a file, etc. All in an easy way, executing native NeoBook subroutines.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npFindCreate

This action creates a new instance of an Find object. The result variable store the ID of the new Seach object. You can use this ID with other plugin actions.

↑↑

npFindDestroy

This action destruct a previously created Find object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. This action The [LastError] variable contain information about the error.

↑↑

npFindDestroyAll

This action destruct all previously created Find object instances.

↑↑

npFindStart

Start the find. This actions perform the find with the options previously setted by other plugin actions or with the find engine default options. Also provide the root directory to begin the find. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindStop

Just stop a previously started find. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindIsRun

Find if a find is running. The result variable store "True" if find is running, "False" if not, or if any error occurr. See [LastError] for information in this last case.

↑↑

npFindOptions

Choose one or more find options. Remember that if you dont use this action, by default the find engine use the "soSearchFiles" option. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirOptions

Use this action to set some find directory options. You can set the recurse depth to 0 (by default) if you want to find in all directories and subdirectories. Set depth to 1 if you want to find if the root directory and first child subdirectories, set to 2 to find in the directories of first child directories and so on.

The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindFileMask

Set the Windows file mask to be used in the find. You can use more than one file mask separating then with the "|" char. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindFileDate

Set the before and after file date to be find. Only files in the date range are considered valid found files. Use the npFindEncodeDate action in order to encode a date variable. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindFileSize

Set a min or and max file size (in bytes) in order to considerer a valid found find. You can set to zero one of this values if you want to find for certain min file size, but dont care about max file size, for example. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindFileAttrs

Choose one or more file attributes to find. You can set an attribute, unset an attribute or "dont care" about an attribute. If you set an attribute, the files must be set this attribute to be considered valid found files. If you unset an attribute, the files must be have unset the attribute to be considerer valid. And if you "don care" about an attribute the find engine dont care about the attribute in files. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindFileTypes

Choose one or more find file types to be performed. In other words, you can find by file masks, but also by file min size and file date, for example.

Remember that if you want to find based on file date, you need to use the appropiate plugin action in order to set the appropiate date range that you want. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirMask

Set the Windows dir file mask to be used in the find. You can use more than one dir file mask separating then with the "|" char. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirDate

Set the before and after dir date to be find. Only dirs in the date range are considered valid found dirs. Use the npFindEncodeDate action in order to encode a date variable. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirSize

Set a min or and max dir size (in bytes) in order to considerer a valid found find. You can set to zero one of this values if you want to find for certain min dir size, but dont care about max file size, for example. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirAttrs

Choose one or more dir attributes to find. You can set an attribute, unset an attribute or "dont care" about an attribute. If you set an attribute, the dirs must be set this attribute to be considered valid found dirs. If you unset an attribute, the dirs must be have unset the attribute to be considerer valid. And if you "don care" about an attribute the find engine dont care about the attribute in dirs. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDirTypes

Choose one or more find dir types to be performed. In other words, you can find by dir file masks, but also by dir min size and dir date, for example.

Remember that if you want to find based on dir date, you need to use the appropiate plugin action in order to set the appropiate date range that you want. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npOnFindAbort

Set a subroutine to be executed when a find is aborted. The instance variable contain the Find object instance that fire the event. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npOnFindDir

Set a subroutine to be executed when the find engine found a valid dir. The instance variable contain the Find object instance that fire the event. The dir variable name store the found dir path. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npOnFindFile

Set a subroutine to be executed when the find engine found a valid file. The instance variable contain the Find object instance that fire the event. The file path variable store the found file path. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npOnFindProgress

Set a subruotine to be executed even the find is in progress.

↑↑

npOnFindBeginDir

Set a subroutine to be executed when the engine begin find in a directory. The instance variable contain the Find object instance that fire the event. The dir variable store the begin dir path. The result variable store "True" if everything is OK, "False" if not. See [LastError] for information in this last case.

↑↑

npFindDrives

Get certain type or all available system drives units. The Drives variable store an Array with matched system drives units paths, like "C:\". The Drives count variable store the number of items in the Drives variable Array. See [LastError] for information about possible errors.

The Drive type param must be one of the following values: DRIVE_ALL, DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM, DRIVE_RAMDISK, DRIVE_UNKNOWN.

↑↑

npFindEncodeDate

Encode the specified year, month and day values into a Date value in order to be use with others plugin actions, like npFindFileDate. The result variable store the date as string is the provided arguments are valid.

If the provide arguments are not valid or if not conform a valid date, the result variable store "False" and the [LastError] store information about the error.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑