In the beginning there was SourceForge

Things come and go. Once Lunarstorm was the place to go to, and Napster was in charge of the music. Then came Facebook, Instagram and Twitter, and today TikTok is very popular. In the software community the changes hasn’t been that big, but a change sure has taken place. Some years ago SourceForge was very popular for storing and sharing Open Software. Today most programmers use a Git-based solution, like GitLab or GitHub.

When I looked at my old projects from my old homepage I found some ancient programming projects, nearly 20 years old. The code was stored on SourceForge, and when looking at my page there I found some more projects. On of them was spaceGuard. The description for the program follows:

spaceGuard sits in the background, monitoring the discspace on a given partition. If the discspace gets below a certain level, a window pops up to warn the user.“.

Ok, might be a useful program :). It was uploaded to SourceForge in 2003, and looking at the code I can see that I used a Linux based system. The GUI is based on GTK, which still is around. Wonder if the code can be compiled and run now in late 2022, almost 20 years after it was written?

I download the project, extracts it and loads the c file in Visual Studio Code. Looks nice, common C code in a file. There is no Readme file, but in the source file there is a GPL license and some short words on how to compile and use the program:

  • File name: spaceguard.c
  • Usage: spaceguard <directory> <interval> <limit>, where interval are in minutes, limit is in Mb
  • To build: gcc -Wall -g spaceguard.c -o spaceguard pkg-config --cflags gtk+-2.0 pkg-config --libs gtk+-2.0 gthread-2.0

Well, let’s try:

gcc -Wall -g spaceguard.c -o spaceguard pkg-config --cflags gtk+-2.0 pkg-config --libs gtk+-2.0 gthread-2.0

But the build failed, as expected as the code probably depends on some really old libraries:

spaceguard.c:29:10: fatal error: gtk/gtk.h: No such file or directory
29 | #include <gtk/gtk.h>

I guess GTK2 is used, and I try to install the gtk2-devel package in my Fedora system:

sudo dnf install gtk2-devel

Now the code compiled, although with some warnings. It also run, but without the graphical window I expected:

 ./spaceguard /home 1 10000
Directory: /home
Interval: 1.000000
Limit (in Mb) 10000.000000

But the problem was soon solved, it was a simple user error 🙂 The window aint supposed to show if the limit is less then the free space on the disk. When I changed the limit to 100000Mb it sure showed up:

All seems fine, and I got a little impressed that this really old code could be compiled and run with hardly any trouble at all. Viva Open Source! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *