In sender scripts to mess with the file name to be written, one must modify
parent.msg.remote_file
in subscribe and/or sarra scripts one must modify:
parent.msg.local_file.
It would be better if there were a single variable used for both cases 'destination_file' ?
When one wants to change the directory in which a local file is placed, one needs to modify two separate fields
parent.msg.local_dir, and parent.msg.local_file.
If you only modify local_dir, the directory gets created, but the file gets written somewhere else.
if you only modify local_file, then the create fails because the expected directory does not exist.
working plugin attached.
would prefer it local_dir would just use local_file, so we didn't need a second directory...
even better would be to derive it from 'destination_file'.
suggested solution:
before calling any on_message / on_part / on_file scripts have:
New standard:
the file to be written is called new_
so new_files, and new_lock
-- in sr_sender these replace: remote_file, remote_lock.
-- in sr_consumers, these replace: local_lock, local_file.
so for compatibility, if local_file or remote_file is changed in a plugin,
after the plugins run, you need to update new_file.
same for local_lock / remote_lock.
same for remote_dir|local_dir needs to update --> new_dir.
on_save_context
-- routine, stores variables in self.xxx -> self.b4.xxx
-- call the on whatever routines.
-- compare the self.xxx and self.b4.xxx
-- if self.xxx != self.b4.xxx :
update self.new_xxx from self.xxx
All the rest of the code needs to be modified to use new_* everywhere.
This is why DESTFNSCRIPT/DESTFN is broken in all consumers right now (refers to remote_file, when it needs to be local_file.)
that's why the priority has been raised.
This is fixed in 2.17.06a2 -- all scripts now use new_file (rather than some subscribers using local_ and sender using remote_ )
Resolved by refactoring between 2.17.07 and 2.18.01