Is it possible to identify what process is changing a file with FileSystemWatcher? - filesystemwatcher

Is it possible to use the FileSystemWatcher to find the PID or process name that is changing a file?

Nope, you need a file system filter driver to track changes with such details.

Negative. The only information you will have is the data contained in the FileSystemEventArgs class, documented here.
This means you only get the type of change that was made, as well as the path to the file that was changed.

Related

How can I add a comment to a LabVIEW file using Python 3

I am trying to create a unique id and attach it to a LabVIEW file so that later I can read back that id and know I am looking at exactly the same file. I must be able to generate the id and read it back programmatically. The information must be hidden from the user accessing the file and persist across operating systems and storage mediums.
I was thinking of just adding it into the file 'comment' section, but it appears the Windows no longer supports file comments.
Any ideas?
I would suggest using the Set Tag method on the VI (with persistence) and saving multiple copies of the VI using the Save Instrument method, where each copy would then have its own unique value of the tag. Note that the method is defined as a scripting method, so you would probably need to enable scripting in the LV options to access it.
I don't think there's any API for enumerating tags, so there would be no way to find the value unless you know what the tag is called. Obviously, it's encoded somewhere in the VI file itself, and presumably it would be possible to extract a list of tags if you know the structure of the file, but that's not knowledge I would expect most students to have.
I'm not sure if you can call the set tag method from Python using an external connection to VI server, but certainly the LV code for this should be pretty simple - basically a for loop with ID generation, a couple of method calls and saving a CSV file so you can keep track of which ID belongs to which student. If you use existing IDs, you don't even need to generate and save the IDs.

Lock rptdesign file

I am trying to find out if it is possible to lock an rptdesign file.
The idea is to run a report as a service, but without being able to change the default parameters. I know I could just hide the parameter window but still the user could edit the rptdesign file and hard code new values.
Does anyone has any previous experience with this?
Is it possible to make an rptdesign file non-editable?
If you want to prevent users by modifying rptdesign file, you should do it on OS level to enable it only for certain users.
If you want to ensure that the report is not modified, you can add hidden field storing md5 sum from report file. I mean that this field can store md5sum from your report file on the disk. Then you can compare it with your original sum.
Anyway your problem is slightly different - you are expecting certain data from your customers and you want to be cheated by them. You can use the method with md5sum but it is rather the matter of trust to them here or any other possibility to access to their database than through the report (e.g. they can give you the direct access to the database or you can agree to store this data in your company, not theirs).
Let me know if this answer helps you better.

What really happens during hybris update?

Does it backup whole database and then reload the data after update? or just adds/removes the affected columns and data in those columns?
By convention when you update a system Hybris will look for impex files matching
projectdata*.impex
When you run initializaton Hybris also look for files matching
essentialdata*.impex
So your question your question Hybris will simply reload data, from projectdata files (pattern could be override on your local.properties file)
Run the dryrun and you can see exactly what it will do.
During an update, type system definitions are modified to match the new type system definition in the items.xml files. You can understand what exactly it do by reading This page
Just to elaborate on Ram Tripathi's answer ...
Entire Type System Is Discarded & Re-Created from the Extension - items.xml.

How to add User Specific information in Exe File

I have a code on the server-side(application) that links with the client-side(application).
The user signs-up to download the exe(client-side application).
There must be a unique way to identify the user(client app exe) with the info got from sign-up.
So, one of the information must be attached to exe file during the download.
One of the ways I found is using "Portable Executable".
Is it possible to add string data to exe and later retrieve it?
Is there any other possible way to make the exe user-specific? Or is it possible to add the user information along with the downloaded exe?
Yes, it is potentially possible to modify the exe at runtime to put your own stream. You might put the User Specific information in an existing Resource prepared for this "update". This would be the easiest way to avoid to take care about changing other parameter like size, etc.. Another option would be to put the User Specific information in the overlay of the Exe.

About Directory Contents in asp.net

I have a directory and I want to save a image in that directory.
How would I know an image already exists in that directory or not?
You can determine if the file exists (by name) using the File.Exists method. There is, however, the possibility of a file being saved with the same name between the time of checking and saving your own.
In a web application I often used mapped GUID values as file names.
Anyway, I think this is what you're asking, though it isn't greatly conveyed as to your exact current predicament.

Resources