GetFiles

Far Manager

GetFiles

The GetFiles function is called to get files from the file system emulated by the plugin.
(FAR to plugin: "I want those files from your panel, destination is specified").
int WINAPI GetFiles(
  HANDLE hPlugin,
  struct PluginPanelItem *PanelItem,
  int ItemsNumber,
  int Move,
  char *DestPath,
  int OpMode
);

Parameters

hPlugin
Plugin handle returned by OpenPlugin or OpenFilePlugin.
PanelItem
Points to an array of PluginPanelItem structures. Each structure describes a file to get.
ItemsNumber
Number of elements in the PanelItem array.
Move
If zero, files should be copied, if nonzero - moved.
DestPath
Destination path to put files. If OpMode flag OPM_SILENT is not set, you can allow the user to change it, but in that case the new path must be copied to DestPath.
OpMode
Combination of the operation mode flags. This function should be ready to process OPM_SILENT, OPM_FIND, OPM_VIEW, OPM_QUICKVIEW and OPM_EDIT flags. Also it can process OPM_DESCR and OPM_TOPLEVEL to speed up operation if necessary.

Return value

If the function succeeds, the return value must be 1. If the function fails, 0 should be returned. If the function was interrupted by the user, it should return -1.

Remarks

  1. The plugin should process "its folders" by itself.
  2. If the operation has failed, but part of the files was successfully processed, the plugin can remove selection only from the processed files. To perform it, plugin should clear the PPIF_SELECTED flag for processed items in the PluginPanelItem list passed to function.
  3. This function is called only for plugins that implement virtual file systems. For this it is necessary to remove the OPIF_REALNAMES flag when GetOpenPluginInfo is called, otherwise this function will never be called.
See also: