Xojo file save

I use a file monitoring tool for backing up file changes for specific development tools, for some reason, the file change detection process will not detect a xojo file being saved? not sure if there is some kind of “magic” happened or if Xojo uses an unusual way to write a file, if I copy the xojo file it is detected as a file change, but not when I save it. So I have 2 questions

  1. How come its not being detected as a file change in the operating system
  2. Is there a way in the IDE to make a script that will “touch” or copy , delete rename the source file so that the operating system sees the change so it can be backed up?

Which OS, which IDE version?

latest version of xojo and on windows (11)

Which type of project do you use? If you use a single file then the file is saved when you select save. But you shouldn’t use a single file ever. Use external files (binary or xml) or text format.

There have been very rare cases of external items not saved. But these have been years in the past. What Xojo still tends to do is change and save more files than it should be.

So please show us exactly what you do and what you see.

So… the IDE performs its file I/O atomically when it comes to saving files. This means that in many cases, the IDE actually saves to a temp file and then when it’s sure that everything is okay, the old file is moved out of the way and the new file is moved into its place, only then does it delete the old file.

If your system tracks files only by their paths, that’ll work just fine, but if it uses some other low-level identifier of the file, you’re going to have problems because the old file no longer exists.

Odd, as if I move a file in the same folder the that is detected ok? I am sure I am capturing renames, but I will check. do you move the temp file to the destination folder then rename it?

IIRC, the file is written to the temp directory with the correct name and just moved to the right place when the other is moved out of the way.

Found it, temp file was being created in the current folder and renamed. File change detection ignored it as it was a create/move not a save. Sorted now thanks.

Xojo_Binary

If you’re using the Xojo text format (not xml) this behavior should have disappeared in mid-2021.

I’m using xml with Xojo 2022r3 and the behaviour is there every day.

Yeah, sorry. The XML format is a direct reflection of the binary format and did not get the optimizations that were done in 2021.

…and this is slow. That is how I notices that I was using the xml version pf the project instead of the binary one… on my m1, lately…