Good day to all. Need at the same time advice on the design of the application and specific assistance.
The task is to clear the metadata before sending for different types of files. Office documents, photos, pdf, etc.
The essence of the application is this - a windows-service rises, which monitors the appearance of files in a folder, processes receipts and transfers the file without metadata to the resulting folder. All is required to be deleted altogether, which can be deleted and / or replaced with empty values.
The self-written variant of extracting and deleting exif / xmp-metadata stumbles upon a huge amount of them, so I was now given exiftool ( https://sno.phy.queensu.ca/~phil/exiftool/ ) and told to work from it. This is a console application written in Perl. For it, there are wrappers in .Net (ProcessStartInfo + Process), but there are some problems.

Question 1 - is it normal to create a console application for each new file (they can be unlimitedly cast into the monitoring folder), or are there any basic rules that are better taken into account. How generally do we allow the console to call from the service and are there any pitfalls?

Question 2 - manual application launch from the windows console uses the console coding, therefore exiftool.exe perfectly recognizes files with Russian letters in the name. How to keep this behavior when wrapping a console call? The -charset filename = CHARSET option stated in the documentation did not help.

Question 3 - if there are exiftool alternatives that allow not only to read the metadata, but also to change them - I will be glad to any direction.

  • exiftool can and change them. And why raise the service? You monitor the necessary folder, when a file appears, you create a separate stream in which you work with the file (you delete the metadata and transfer it) and a truncated Lolidze
  • @Lolidze because remembering that you need to restart the application, which none of the admins will monitor something there. But this is half the trouble in general. I still do not understand how to work with Russian letters in the file name. Do you have experience with exiftool? When parsing the wrapper, I see. that the application always returns {ready} and not a word about whether the file was processed or not, and why. Those. On the picture with the name in Russian, it will be ready ready and that's it. It is clear that this is not the expected answer, but I would like details from the application. - Skarhl
  • one
    Well, you can just set up an audit for a folder and set the system scheduler on audit events. In the scheduler, throw a batch file for ExifTool, or just a start command, if one command is enough, and there should not be any problems with the encoding. The batch file is better, of course, to process several files in a loop, auditing (like FileSystemWatcher) sometimes skips events - rdorn
  • @rdorn and can be a little more detail? now I have a network folder, with a very extensive system of subfolders (up to 5 thousand items at level 1, in each folder there is a random number of documents and nesting level). Now I have a service that monitors the event of copying a file into this structure, starts processing in a separate thread, and puts the result in the final folder, which is created at the same level as the file, if not created earlier. All errors are put into the events of Windows, and from there are sent to the addressees of a separate prog. How can this be done by a scheduler? Where to read? - Skarhl
  • one
    But maybe it will not suit you, you just indicated in the comments that there are additional tasks. If you can write a script in the console to perform these tasks, then this script can be bolted to the scheduler, if the command line is not enough to solve, you can try PowerShell (supports C #), JScript or VBScript, whichever is closer to you. The task is, in general, admin's, and it can be solved almost without programming (minimal scripting if you have the necessary console tools), you decide. - rdorn

0