Assigning categories, then moving file: categories get lost.

Started by ubacher, June 15, 2017, 11:06:19 AM

Previous topic - Next topic

ubacher

Important: I am using manual indexing of files!

In a script:
When I move a file with IMatch.fileMove the file is moved and it shows in its original place as being no longer on disk.
In the folder it has been moved to it will not show up until I rescan it.
Then it shows up but without the categories which I assigned previous to the move.

Mario

There are file-system operations, intended to be used to move arbitrary files around.
Please always use IMatch database functions to work with files indexed in an IMatch database.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

?? What do I have to use in place of IMatch.fileMove?

Mario

I assume you are trying to write an app which moves a file contained in your database from one folder to another.

This would require functions in IMWS which can do that, Such are currently not available. Currently IMWS only provides update functions for categories, collections, metadata and Attributes. Functions to add, update and remove files and/or folders will be added to a later version of IMWS, if I have figured out how to do this safely. And then this functionality will also be available in IMatch of course.

Feel free to add feature requests for functionalities you would like to see in future editions of IMatch / IMWS or IMatch Anywhere.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

So there's currently no rename function either, I suppose?

Mario

For files not in the database you can use IMatch.fileMove. Same path, just another name for the target.

Copy/Move/Rename file is a function block and they will be added to IMWS as such.
Copy/Move/Rename folder is a function block and they will be added to IMWS as such.

While in IMatch I have to deal only with one user, IMWS needs additional mechanisms to allow functions like moving or renaming a file to work safely, even when multiple users are currently working with IMatch/IMWS. Same for folder functions, category and metadata functions etc. While I can optimize these things and take shortcuts in the case of the IMWS "embedded" in IMatch, the implementation must be safe and sound for both use cases.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on June 20, 2017, 06:18:45 PMWhile I can optimize these things and take shortcuts in the case of the IMWS "embedded" in IMatch, the implementation must be safe and sound for both use cases.

I'm sure that a single common implementation would be simpler to maintain and debug, hence safer and faster to implement.
Too bad that such functions, which were included in the old iMatch Basic engine, didn't make it into the first IMWS based version without the Basic engine. Any scripts that use such missing functions cannot yet be migrated/rewritten.

Mario

The object model for IMatch 3/4/5 was extended over several years. Not everything was there for a start.

Please understand that while you surely miss some scripting functions (and other users may miss other scripting functions), the majority of IMatch users does not need or use scripts or apps at all. Users have different priorities, and what may mandatory in a corporate context may be totally irrelevant for 'home' users.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook