Thanks for the input everyone. Very informative.
Re-coding now.
Vern
TS3.03ce - USB device manager
Cheers Vern
Thanks for testing everyone. Ive finally found my usb drive so I will join in on the next run. Im looking forward to your updated code.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
Sorry folks. This project for Talking Stick is dead. I've been trying to build this in puppy 3.01 and am beating my head against a wall. And unless someone can explain this to me I can only conclude that the gtk version included with 3.01 is junk. Bear with me, I'd like to explain my reasons for dumping the project.
Take a look at this function. It's called from the mount/unmount dialog when the mount button is clicked. It's a little butchered from my efforts to track down the segmentation faults, but what the heck.
Here is the output from compile to Ctrl-c with a couple of comments spliced in. The 'dialog is open' lines represent a global flag that is set to true and should remain true until this dialog is destroyed. FYI each 'DEBUG: dialog is open =' line represents one scan at 2 second intervals. Nothing else in the code sets it to false but notice that it gets reset after one routine is called from a timer callback. The value should have remained 1 all the way through this output. That's just one thing. Notice what happens to ptinfo->name! Where the heck does EEK// come from? On a different run it was changed to 'DR boot loader'! This is the kind of crap I'm constantly running into.
I think I'll continue this under puppy 2.14. Maybe it can be salvaged for the future.
Vern
Take a look at this function. It's called from the mount/unmount dialog when the mount button is clicked. It's a little butchered from my efforts to track down the segmentation faults, but what the heck.
Code: Select all
gboolean mount_from_tree_list(gchar* listname, gchar* retstr){
GSList *Lnk = NULL;
partinfo *ptinfo = NULL;
gchar **oneline = NULL;
gchar **output = NULL;
char txt[25];
char txt2[25];
Lnk = ptlist;
while(Lnk != NULL) {
ptinfo = Lnk->data;
if (ptinfo){
if (strcmp((char *)ptinfo->mntpoint, "void")){
if (!strcmp(listname, ptinfo->desc)){
g_debug("Before Mounting ptinfo->name = %s",ptinfo->name);
g_debug("Before Mounting mountflag = %d",ptinfo->mountflag);
g_debug("Before Mounting mount point = %s",ptinfo->mntpoint);
oneline = g_strsplit ((gchar*)ptinfo->name, "/", -1);
g_snprintf(txt,sizeof(txt), "mkdir /mnt/%s ", oneline[2]);
g_snprintf(txt2, sizeof(txt2), "/mnt/%s ", oneline[2]);
g_spawn_command_line_sync((gchar*)txt, (gchar **)&output,
NULL, NULL, NULL);
g_free ((gchar*)output);
g_snprintf(txt, 50, "%s %s %s %s", "mount -t",
(char*)ptinfo->fmt,
(char*)ptinfo->name,
(char*)txt2);
g_spawn_command_line_sync((gchar*)txt, (gchar **)&output,
NULL, NULL, NULL);
g_free ((gchar*)output);
ptinfo->mountflag = TRUE;
g_stpcpy(ptinfo->mntpoint,txt2);
g_strfreev (oneline);
g_stpcpy(retstr,txt2);
g_debug("After Mounting ptinfo->name = %s",(gchar*)ptinfo->name);
g_debug("After Mounting mountflag = %d",ptinfo->mountflag);
g_debug("After Mounting mount point = %s",ptinfo->mntpoint);
return TRUE;
}
}
}
Lnk = Lnk->next;
}
return FALSE;
}
Code: Select all
# ./compile-usbmount
# ./usbmount
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: ADDING ptinfo->name = /dev/sda1
- The dialog is opened here
** (usbmount:1856): DEBUG: dialog is open = 1
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
- The mount button is clicked
** (usbmount:1856): DEBUG: Before Mounting ptinfo->name = /dev/sda1
** (usbmount:1856): DEBUG: Before Mounting mountflag = 0
** (usbmount:1856): DEBUG: Before Mounting mount point =
mkdir: cannot create directory '/mnt/sda1': File exists
** (usbmount:1856): DEBUG: After Mounting ptinfo->name = EEK//
** (usbmount:1856): DEBUG: After Mounting mountflag = 1
** (usbmount:1856): DEBUG: After Mounting mount point = /mnt/sda1
** (usbmount:1856): DEBUG: dialog is open = 0
- The unmount button is clicked and the device is unmounted
** (usbmount:1856): DEBUG: dialog is open = 0
- The mount button is clicked again
** (usbmount:1856): DEBUG: Before Mounting ptinfo->name = /dev/sda1
** (usbmount:1856): DEBUG: Before Mounting mountflag = 0
** (usbmount:1856): DEBUG: Before Mounting mount point =
mkdir: cannot create directory '/mnt/sda1': File exists
** (usbmount:1856): DEBUG: After Mounting ptinfo->name = EEK//
** (usbmount:1856): DEBUG: After Mounting mountflag = 1
** (usbmount:1856): DEBUG: After Mounting mount point = /mnt/sda1
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
- The dialog is still open at this point.
- Ctrl-c.
Vern
GTK
Hi 2byte
If the GTK version that is used in puppy 3.xx is broken, then we can fix it!!! If its causing problems for this then it is likely that it will cause problems in the future too. Let us know how you get on with it in puppy 2.14 (which has a different gtk version). You might want to look up this problem on the GTK forums too as it sounds quite specialist. Hope you can get the project started again.
If the GTK version that is used in puppy 3.xx is broken, then we can fix it!!! If its causing problems for this then it is likely that it will cause problems in the future too. Let us know how you get on with it in puppy 2.14 (which has a different gtk version). You might want to look up this problem on the GTK forums too as it sounds quite specialist. Hope you can get the project started again.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
any progress beig made here?
gtk upgrade needed? I think that is an option since even the kernel will be rebuilt...and eco seems to have alluded to upgrading gtk above
issue resolved?
gtk upgrade needed? I think that is an option since even the kernel will be rebuilt...and eco seems to have alluded to upgrading gtk above
issue resolved?
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30
No, been working on other things for TS3.03.any progress beig made here?
I have given it a lot of thought and I believe my mistake was using GTK for the linked list and script executions instead of using C. GTK seems to be fine for the gui. I will start from scratch and try to get it done and tested before the release date.
Pdrive is very good too, although it's still beyond the ken of ordinary win refugees. I know because my wife and daughter try this stuff out for me. You should see the look on their faces when presented with all of that drive info! What's this? What do I do now? Is it ok to ignore this and close it?
2byte
2 Byte,
Glad to see you have regained your enthusiasm for this project. and Im also glad that you have some people you can test your work on for this. Believe me I know exactly the "look" you are talkiing about!
Glad to see you have regained your enthusiasm for this project. and Im also glad that you have some people you can test your work on for this. Believe me I know exactly the "look" you are talkiing about!
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
Device Manager
With the change of the project base to 2.14r, an already functioning usb device manager is already included!!! hurrah! It also picks up all of the disks and cd's.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!