Re: [AMMRL] AMMRL: Accounting by computer login - How to prohibit gaming the system

From: serge_lavoie via groups.io <serge_lavoie=uqac.ca_at_groups.io>
Date: Tue, 26 Aug 2025 07:58:18 -0700

I have implemented the AU script below (trace_zg). I then updated all the
au_zg scripts in the TopSpin folder so that my script is executed twice:

> XAU("trace_zg","zg_debut")
>
> ZG_OVERWRITE
>
> XAU("trace_zg","zg_fin")
>

This way, a MIRE_log.txt file is created in every acquisition folder, containing
the Unix timestamp of both the start (zg_debut) and the end (zg_fin) of the
experiment. Fun fact, it works for TopSpin 4.5 (Almalinux) and my old XWinNMR 3.5
(windows xp VM on windows 11).

I also wrote a Python script that searches the data folder for experiments
within a specified date range and logs duration of each experiment by user.
I can share this script on demand.

> ########## trace_zg ###################
>
> #include <stdio.h>
>
> #include <time.h>
>
> AUERR = trace_zg();
>
> QUIT
>
> int trace_zg() {
>
> // Ouvrir le fichier en mode ajout ("a" pour append)
>
> FILE *fichier = fopen(ACQUPATH("MIRE_log.txt"), "a");
>
> if (fichier != NULL) {
>
> // Écrire la date et l'heure dans le fichier
>
> fprintf(fichier, "%s : %d\n", i_argv[2], (int)time(NULL));
>
> // Fermer le fichier
>
> fclose(fichier);
>
> } else {
>
> // Gestion de l'erreur si le fichier ne peut pas être ouvert
>
> printf("Erreur : Impossible d'ouvrir le fichier.\n");
>
> }
>
> return 0;
> }
>

Sincerely,

*Serge Lavoie*
Professeur
Sciences fondamentales
Local P4-2030
Université du Québec à Chicoutimi
555, boul. de l'Université
Chicoutimi (Québec) G7H 2B1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#2752): https://urldefense.com/v3/__https://ammrl.groups=
.io/g/main/message/2752__;!!PvDODwlR4mBZyAb0!RLEBe61N3s7N9QaEker2B8GSP3bobg=
yWKyhqqv3ehZ5iLsRnXZdGqodjH4V4DmP47uwj3N39M0ufsZ9RRLMjaJwT9nmn$
Mute This Topic: https://urldefense.com/v3/__https://groups.io/mt/114891633=
/7559972__;!!PvDODwlR4mBZyAb0!RLEBe61N3s7N9QaEker2B8GSP3bobgyWKyhqqv3ehZ5iL=
sRnXZdGqodjH4V4DmP47uwj3N39M0ufsZ9RRLMjaPbebhHr$
Group Owner: main+owner_at_ammrl.groups.io
-=-=-=-=-=-=-=-=-=-=-=-




Received on Tue Aug 26 2025 - 08:40:13 MST

This archive was generated by hypermail 2.4.0 : Mon Sep 01 2025 - 15:37:08 MST