Re: [Gpsbabel-misc] Setting temp path without Windows environmental variable
GPSBabel converts and transfers data like waypoints, tracks & routes.
Brought to you by:
robertl
|
From: Robert L. <rob...@gp...> - 2017-09-07 21:57:05
|
Hi, Phillip and welcome. You're right. The code gets the temporary directory from the OS, but then doesn't use QTemporaryFile <http://doc.qt.io/qt-5/qtemporaryfile.html> to ensure that the file within it is unique. I can't dive into the code right now, but it's just so hokey that that format alone (I think) writes a file while you're reading. If you're automating this, I'd think that scripting this in a batch file would look something like mkdir temp/1 temp/2 temp/3 set TMP=C:\temp\1\ && gpsbabel.exe -w -t -i mtk -f COM6 -o gpx1 -F test.gpx set TMP=C:\temp\*2*\ && gpsbabel.exe -w -t -i mtk -f COM7 -o *gpx2* -F test.gpx set TMP=C:\temp\*3*\ && gpsbabel.exe -w -t -i mtk -f COM8 -o *gpx3* -F test.gpx ...but that does them one at a time and I'm guessing the real goal is to do them at the same time. Again, making this up because I'm not a windows dev, bug I can read stack overflow... start cmd /c call set TMP=C:\temp\1\ && gpsbabel.exe -w -t -i mtk -f COM6 -o gpx1 -F test.gpx start cmd /c set TMP=C:\temp\*2*\ && gpsbabel.exe -w -t -i mtk -f COM7 -o *gpx2* -F test.gpx start cmd /c set TMP=C:\temp\*3*\ && gpsbabel.exe -w -t -i mtk -f COM8 -o *gpx3* -F test.gpx but there may be some quoting rules that I'm breaking. Start with something like https://stackoverflow.com/questions/649634/how-do-i-run-a-bat-file-in-the-background-from-another-bat-file Really, this code just needs to be fixed to Not Do This. Any takers? RJL On Thu, Sep 7, 2017 at 2:49 PM, Philip Shemella <phi...@zo...> wrote: > Hi All > > When I run the code to extract from MTK and convert to GPX, the code reads > my Windows environmental variable TMP and write a temp file "data.bin" in > that folder (at least this is what I've learned from a bit of reverse > engineering). I can set a temporary new path for TMP before running > gpsbabel.exe from the command line: > > set TMP=C:\temp\ && gpsbabel.exe -w -t -i mtk -f COM6 -o gpx -F > test.gpx > > Is there a built-in way to define the temp folder, without using Windows > environmental variables? Perhaps with gpsbabel.ini? > > The reason for this question is that I'd like to reliably extract data > from devices in parallel, and I'm expecting that setting the windows > environmental variable TMP on several concurrent threads will have > conflicts. > > Many thanks > Philip > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Gpsbabel-misc mailing list http://www.gpsbabel.org > Gps...@li... > To unsubscribe, change list options, or see archives, visit: > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc > > |