Good point about g_spawn_async_with_pipes() being cross platform.
However fdopen() and waitpid() aren't. WaitForSingleObject() can be used instead of waitpid() for Windows. [or we could use g_child_watch_add () instead and an appropriate callback http://developer.gnome.org/glib/2.32/glib-The-Main-Event-Loop.html#g-child-watch-add ] Unfortunately fdopen() replacement is a bit more complicated... http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx I should be able to create a patch that supports a progress callback on Windows. This is less work than I previously thought with the CreatePipe() method. Be Seeing You - Rob. If at first you don't succeed, then skydiving isn't for you. ---------------------------------------- > Date: Wed, 5 Sep 2012 11:55:03 +0200 > Subject: Re: [Viking-devel] GPSbabel and viking on windows > From: guilhem.bonnefi...@gmail.com > To: rw_nor...@hotmail.com > CC: viking-devel@lists.sourceforge.net > > Hi, > > Thanks Robert for sharing your analysis. > > Just a naïve question: why viking has specific code for windows here? > Reading documentation, it seems that g_spawn_async_with_pipes works > under windows. > http://developer.gimp.org/api/2.0/glib/glib-Spawning-Processes.html#g-spawn-async-with-pipes > > Can someone test by removing the windows specific code? > > > 2012/9/5 Robert Norris <rw_nor...@hotmail.com>: > > > > > > The code has never had progress support of GPSBabel on Windows. > > > > I think the best approach for now is to simply hard code the list of > > devices back in again (albeit just for Windows) as attached. > > > > I think some form of pipe is needed to be created to access the StdOut > > stream, but this is much more complicated on Windows: > > > > http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx > > > > And without a build environment for Windows, I'm not even going to try to > > attempt to resolve it. > > > > Be Seeing You - Rob. > > If at first you don't succeed, > > then skydiving isn't for you. > > > > > > ---------------------------------------- > >> From: rw_nor...@hotmail.com > >> To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com > >> Date: Tue, 4 Sep 2012 21:20:07 +0100 > >> CC: viking-devel@lists.sourceforge.net > >> Subject: Re: [Viking-devel] GPSbabel and viking on windows > >> > >> > >> > >> I think I've found the problem. > >> > >> Unfortunately no immediate solution springs to mind :( > >> > >> Inspecting the babel.c code one can 'quickly' realise that there is only > >> *one* call made to the callback indicating the process has completed (i.e. > >> done - see line 157) for the Windows version. > >> > >> Whereas the 'Linux' code has two uses, for completion (line 193) and > >> *during* the process (line 190) for diagnostic purposes. > >> > >> Hence I can surmise the Windows version never gives the user feedback > >> during the Acquiring GPS points up/download - it just completes at some > >> point. > >> > >> Unfortunately in finding the available devices list it uses the diagnostic > >> method, which as not available in Windows meaning it leaves the devices > >> list blank. > >> > >> IIRC the babel code was refactored 'recently'. Maybe an old version has a > >> better Windows function which has some progress callback but I doubt it. > >> > >> Be Seeing You - Rob. > >> If at first you don't succeed, > >> then skydiving isn't for you. > >> > >> > >> ---------------------------------------- > >> > From: rw_nor...@hotmail.com > >> > To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com > >> > Date: Tue, 4 Sep 2012 18:59:32 +0100 > >> > CC: viking-devel@lists.sourceforge.net > >> > Subject: Re: [Viking-devel] GPSbabel and viking on windows > >> > > >> > > >> > > >> > The '^' character is an escape character in DOS. > >> > > >> > Thus for windows it needs to be escaped itself: thus needs to be "-^^3" > >> > for Windows systems. > >> > > >> > > >> > Be Seeing You - Rob. > >> > If at first you don't succeed, > >> > then skydiving isn't for you. > >> > > >> > > >> > ---------------------------------------- > >> > Date: Tue, 4 Sep 2012 11:44:26 +0200 > >> > From: guilhem.bonnefi...@gmail.com > >> > To: mathie...@gmail.com > >> > CC: viking-devel@lists.sourceforge.net > >> > Subject: Re: [Viking-devel] GPSbabel and viking on windows > >> > > >> > > >> > Hi, > >> > > >> > 2012/9/4 Mathieu <mathie...@gmail.com>: > >> > >> The other one is with the new "File->Acquire->Acquire from GPS". In > >> > >> the following dialog, the "GPS Protocol" menu is empty. I do not > >> > >> reproduce this under Linux. Can someone running viking on windows do > >> > >> the test? It is really simple, just open the dialog and report the > >> > >> available entries. > >> > > > >> > > I confirm the problem. > >> > > And I wil add one : when you try to import a file with GPSBabel, the > >> > > file type menu is also empty. > >> > > >> > Thanks for confirmation. These lists are build with some gpsbabel > >> > output. The command line use "-^3" switch. Can you try to launch > >> > gpsbabel with this switch on windows to check is availability? > >> > > >> > > Windows builds really need some in-depth testing. > >> > > >> > Certainly. > >> > Perhaps adding some automatic test can help in this process. Here is a > >> > really initial patch to verify gpsbabel. Currently, the patch include > >> > only a "dump" tool, but in few hours (I'm at office), it will consist > >> > on something checking that we retrieve what we expect. But I imagine > >> > this single executable can already help to investigate. > >> > > >> > -- > >> > Guilhem BONNEFILLE > >> > -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com > >> > -=- mailto:guilhem.bonnefi...@gmail.com > >> > -=- http://nathguil.free.fr/ > >> > > >> > ------------------------------------------------------------------------------ > >> > Live Security Virtual Conference > >> > Exclusive live event will cover all the ways today's security and > >> > threat landscape has changed and how IT managers can respond. Discussions > >> > will include endpoint security, mobile security and the latest in malware > >> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > >> > _______________________________________________ > >> > Viking-devel mailing list > >> > Viking-devel@lists.sourceforge.net > >> > https://lists.sourceforge.net/lists/listinfo/viking-devel > >> > Viking home page: http://viking.sf.net/ > >> > > >> > ------------------------------------------------------------------------------ > >> > Live Security Virtual Conference > >> > Exclusive live event will cover all the ways today's security and > >> > threat landscape has changed and how IT managers can respond. Discussions > >> > will include endpoint security, mobile security and the latest in malware > >> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > >> > _______________________________________________ > >> > Viking-devel mailing list > >> > Viking-devel@lists.sourceforge.net > >> > https://lists.sourceforge.net/lists/listinfo/viking-devel > >> > Viking home page: http://viking.sf.net/ > >> > >> ------------------------------------------------------------------------------ > >> Live Security Virtual Conference > >> Exclusive live event will cover all the ways today's security and > >> threat landscape has changed and how IT managers can respond. Discussions > >> will include endpoint security, mobile security and the latest in malware > >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > >> _______________________________________________ > >> Viking-devel mailing list > >> Viking-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/viking-devel > >> Viking home page: http://viking.sf.net/ > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Viking-devel mailing list > > Viking-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/viking-devel > > Viking home page: http://viking.sf.net/ > > > > -- > Guilhem BONNEFILLE > -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com > -=- mailto:guilhem.bonnefi...@gmail.com > -=- http://nathguil.free.fr/ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/