GTKdialog3 program debugging

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

GTKdialog3 program debugging

#1 Post by 8-bit »

When I create a GTKdialog script, I actually have the script open in Geany.
I have saved said script to a directory and open a terminal in that directory.
I then run the script from the terminal.
Errors are echoed back to the terminal when the script runs and if I see a problem, I exit the program/script , edit it in Geany, save it, and run again.
I did find one thing one has to watch for.
If a called external program run from the script needs some parameters,
look out for those that are also parameters for GTK.
As an example, when running mkdosfs -c -I /dev/sde
the -c is interpreted by GTK as it's own and is not passed to the external program. The same could be said for -f.

Also, in between versions of Puppy, paths to executables seem to have changed and some supporting programs seem to have been removed.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2 Post by 01micko »

look out for those that are also parameters for GTK.
As an example, when running mkdosfs -c -I /dev/sde
the -c is interpreted by GTK as it's own and is not passed to the external program. The same could be said for -f.
Does it help if you surround the call with double quotes? Of course these need to be escaped with a back slash.

I always use a functions file, no such problems.

Cheers
Puppy Linux Blog - contact me for access

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post by 8-bit »

Well, I had one external program that echoed it's name and version when It started. The version was being interpreted as a destination and I got an error showing the version with a file not found.
I got around this by putting the command with the options I wanted in a variable and running the variable.
For example:
CHKBOX1=mkdosfs -v -c -I
#Other variables are already set up with other parameters.
if condition_met
$CHKBOX1 $PARM1 $PARM2
else
Display message or do another call
fi

The variables are run as a command in their entirety.
But in my two Puppy test cases running the command in a terminal,
in Puppy 4.2.1, if you run #mkdosfs -c -v -I /dev/sde
You get a diskcheck before the format signified by the -c
In Puppy 4.3.1 the -c is ignored.
I assume this since you get feedback showing a diskcheck running in Puppy 4.2.1 and you do not in Puppy 4.3.1

Post Reply