Gumpf
Posted
#1
(In Topic #1367)
Guru

i have now also added ~/.cache to the list as i found over 800 org.gambas.* dead folders in there.
But i made a quick gbs script for everyone.. (attached)
it checks for residual gambas folders matching…
/tmp/gambas.1000/****
/run/user/1000/gambas/****
$HOME/.local.share/org.gambas.****
$HOME/.cache/org.gambas.****
It checks if the number (ID) of the folder number matches a running process ID in /proc/
Lists all orphaned folders that no longer match a live process ID and offers to clean up if you want..
PS. i think if your programs use Quit to exit you have more chance of getting these dead folders as when a program is Quit it does not clean up after itself like in a normal clean exit.
Like i said i found over 800 folders in ~/.cache the other day
All it takes is logging out/shutting down while a program is running.
I'd be curious to know if anyone else finds a shockingly large amount of dead folders, just run the attached gb_gumph script in a terminal.
PPS. the temporary folders in /tmp/gambas.1000/ (File.Dir(File.Dir(Temp()))) and /run/user/1000/gambas (Env["XDG_RUNTIME_DIR"] &/ "gambas") don't mean very much as they get destroyed on each reboot. If you do find a lot of stuff in them it's probably due to program using Quit. Thee files in $HOME are there for good unless we remove the unused ones.
This is my output (after about only 2 hours from my last clean) 41 orphans already.
Code
bonus:~$ gb_gumph
Items with a matching process...
/tmp/gambas.1000/4131 ok
/tmp/gambas.1000/2665 ok
/tmp/gambas.1000/7247 ok
/tmp/gambas.1000/2664 ok
/tmp/gambas.1000/7245 ok
/tmp/gambas.1000/2823 ok
/run/user/1000/gambas/4131 ok
/run/user/1000/gambas/2664 ok
Orphaned items...
~/.cache/org.gambas.102814
~/.cache/org.gambas.100140
~/.cache/org.gambas.95099
~/.cache/org.gambas.5046
~/.cache/org.gambas.90194
~/.cache/org.gambas.102376
~/.cache/org.gambas.6278
~/.cache/org.gambas.91214
~/.cache/org.gambas.88770
~/.cache/org.gambas.93793
~/.cache/org.gambas.93158
~/.cache/org.gambas.94453
~/.cache/org.gambas.91859
~/.cache/org.gambas.92498
~/.local/share/org.gambas.17016
~/.local/share/org.gambas.102814
~/.local/share/org.gambas.100140
~/.local/share/org.gambas.22804
~/.local/share/org.gambas.6476
~/.local/share/org.gambas.16855
~/.local/share/org.gambas.7157
~/.local/share/org.gambas.13833
~/.local/share/org.gambas.5046
~/.local/share/org.gambas.17305
~/.local/share/org.gambas.102376
~/.local/share/org.gambas.7521
~/.local/share/org.gambas.7868
~/.local/share/org.gambas.6278
~/.local/share/org.gambas.8156
~/.local/share/org.gambas.11823
~/.local/share/org.gambas.17084
~/.local/share/org.gambas.6875
~/.local/share/org.gambas.6596
~/.local/share/org.gambas.31694
~/.local/share/org.gambas.6248
/tmp/gambas.1000/6961
/tmp/gambas.1000/6571
/tmp/gambas.1000/6966
/tmp/gambas.1000/6566
/run/user/1000/gambas/5046
/run/user/1000/gambas/6278
Found 14 orphaned items in ~/.cache
Found 21 orphaned items in ~/.local/share
Found 4 orphaned items in /tmp/gambas.1000
Found 2 orphaned items in /run/user/1000/gambas
Found a total of 41 orphaned items...
Type y to delete them or return to quit.
The script…
Code (gambas)
- Print "Items with a matching process..."
- aList.Remove(c)
- aList[c] = sDir &/ aList[c]
- aFound.insert(aList)
- aMsg.Add("\e[" & If(aList.Count, "91", "92") & ";3mFound " & aList.Count & " orphaned items\e[0m in " & sDir)
- Print "\n\e[92;3mNo obsolete folders found :)\e[0m"
- Print "\nOrphaned items..."
- Print "Type y to delete them or return to quit."
Posted
Guru

It warns on the wiki that you should not use Quit in a GUI application.
I guess it's right.
I am guilty of this an a couple of my programs , I am removing Quit as the easy exit on them and fixing why i needed to use it in the first place.
Posted
Guru

It is much better now
you may still find gumph when developing a program as the program might crash while testing then it does not go through it exit routine and clean up.
I'm currently writing a program to monitor/manage/auto-remove any gambas gumph
Posted
Guru

1 guest and 0 members have just viewed this.



