Re: any tricks to make SHELL non blocking?
On Tue, Feb 6, 2018 at 3:28 PM, Warren Samples via use-livecode < use-livecode@lists.runrev.com> wrote: > >> > With all due respect, this is not all correct information. It is perfectly > valid to escape using single quotes (and double quotes) on the command line hmm, for spaces, that seems to be correct. But that just proves the point; spaces in filenames are evil :) I learned unix on a cluster PDP-11 over three decades ago, and I'm still off on this. There are other things, however, notably environmental variables, that do not get escaped in the weak quoting of double quotes. > and it works inside a LC shell function. > > Just to save time, here are some sources for verification: > > https://www.tech-otaku.com/mac/file-folder-paths-os-x-terminal/ > > http://wiki.bash-hackers.org/syntax/quoting (see "Weak quoting" and > "Strong quoting" careful; OSX defaults to tcsh, not bash. -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 02/06/2018 07:35 PM, hh via use-livecode wrote: You are obviously an expert with the shell/unix. Nothing of the sort, I'm just sharing some information I have collected from other sources and have found to work in this kind of situation :D Warren ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
> Warren S. wrote: > The dictionary says: "On OS X systems, you can use the open process > command to start up an application, but not a Unix process. To work with > a Unix process, use the shell func instead." That makes me wonder if you > can only use shell() with ffmpeg. It is not quite clear what is meant with "Unix process" in the dictionary. This is, at any rate, not the same as "Unix executable" in the sense of MacOS. Probably a standard like https://en.wikipedia.org/wiki/List_of_Unix_commands ffmpeg isn't such a standard, but doesn't work with open process, others do. I use "open process p0 for neither", where p0 is a variable of type " ", with success for several other unix executables. Back to "shell": You are obviously an expert with the shell/unix. It would be greatly appreciated if you would share a general non-blocking shell command: Non-blocking shells are often needed/wanted and you could write a command which collects the advices from your last post. In the special case of ffmpeg it may even be possible to redirect STDERR to a file that can be scanned while a large job is running? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 02/05/2018 11:04 PM, Stephen Barncard via use-livecode wrote: I have this open sourced app ffmpeg and I need to copy the first file from a CD, convert it to a wav file, name it, and save it to a file on a hard drive. (the executable is located in the same folder as the stack, hence the ./ ) so my generated command used with the shell command is: *./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' thanks for any suggestions... The dictionary says: "On OS X systems, you can use the open process command to start up an application, but not a Unix process. To work with a Unix process, use the shell func instead." That makes me wonder if you can only use shell() with ffmpeg. Did you try the suggestions from the other thread? Did they not do what you needed? get shell ("nohup mycommand --some-params 'can use single quotes to escape if necessary' &") here the command is prefaced with 'nohup' and a space and is closed with a space and & There are several variations for redirecting to /dev/null which also work to make the shell() non-blocking. Here's an example: get shell ("mycommand --some-params 'can use single quotes to escape if necessary' /dev/null &") Using your example given here, they might look like this (linebreaks may not be correct due to email fun): get shell("nohup ./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' &") OR get shell("./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' /dev/null &") The method using 'nohup' *might* cause a problem due to not finding ffmpeg at its path relative to your LiveCode app. If it fails, that would be the first thing to troubleshoot. Good luck! Warren ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 02/06/2018 10:25 AM, Dr. Hawkins via use-livecode wrote: double quotes cause evaluation (for shell variables?), back quote (`) causes contents to execute. You seem to be using ', which is a literal. You have*SPACES* in file names. This*ALWAYS* leads to suffering. Quoting a filename does not make it ok; it's still multiple words. If you want to keep such evil names, you'll have to escape those spaces with \ (backslash). With all due respect, this is not all correct information. It is perfectly valid to escape using single quotes (and double quotes) on the command line and it works inside a LC shell function. Just to save time, here are some sources for verification: https://www.tech-otaku.com/mac/file-folder-paths-os-x-terminal/ http://wiki.bash-hackers.org/syntax/quoting (see "Weak quoting" and "Strong quoting") Warren ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Tue, Feb 6, 2018 at 12:03 PM, Stephen Barncard via use-livecode < use-livecode@lists.runrev.com> wrote: > Mike Bonner: I'll try the Open Process suggestion you made - again with > more syntax variations this time. thanks! > > Dr Hawkins - I don't have control over the name of the CD source file.. > You can change them. once you have the name in filNam, put filNam into newFilNam replace space with "\ " in filNam replace space with "_" in newFilNam get shell ("mv filNam newFilNam") or, just use newFilNam--but spaces in filenames are always going to hurt and cause problem, not mater the source. > > > Dr Hawkins: when you say "escape spaces" do you mean something like > > \%20 > ack, no! that's html! > > or > > \[actual space char] > yes, this--it's not a regex, but the shell recognizes this an a couple of others, some with different meanings than in a regex -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Mike Bonner: I'll try the Open Process suggestion you made - again with more syntax variations this time. thanks! Dr Hawkins - I don't have control over the name of the CD source file.. 1 Audio Track.aiff the OS demuxes the data on the CD and gives them generic names. surely there must be a way to encapsulate URL strings properly to use spaces and hyphens. Do I have to add the escapes manually using lookups and exceptions? the folder names are no big deal to fix, but I've got a library of hundreds of shows where I already use hyphens and have been successfully imported.. Dr Hawkins: when you say "escape spaces" do you mean something like \%20 or \[actual space char] ? I only care about this working on Macs, by the way. This is just an ugly thing that saves me time in a huge archive project. The UI sucks, but it's all just for me. This "app" I've created allows me to save keystrokes in the process of: 0. assign a name to the performance, type in a field (I avoid spaces but there are hyphens - I could use underscores I guess but they look so ugly - perhaps I can 'get away' with those on a mac. 1. taking a picture of the CD, cover and contents and saving as a file (using oss imagesnap and a webcam) (I would have used a flatbed scanner but I couldn't find a useable oss executable and scanning and loading is slower ) 2. importing the first CD file after it is inserted, converting it to WAV from AIF, and saving it with with the chosen name. (using ffmpeg) 3. create a folder with the chosen names and put the like named files ( with .png and .wav suffixes ) in that folder. (using Livecode) metadata (like song titles) could be put into a .txt file in that folder later. I plan a bot that will send samples to a Grace Note like service to harvest song titles. My idea is that the file structure and meta ARE the database and a data listing could be created from that structure 'just in time'. This is important in an archive that is rapidly getting added to or changed (like filenames !!) and makes more sense to me that having to enter and update a separate database. The archive is limited enough in items that speed is not an issue. this has taken the process from taking three separate apps (including the dreaded iTunes and Photobooth?? ) and dozens of clicks, cut and paste names etc.) and lots of typing to a single entity where I only have to enter that name ONCE. And iTunes import and convert took 10 minutes for a 60 minute piece - whereas ffmpeg takes only 2:15. I can do a turnaround within 4 minutes now. thanks for the tip on quotes and backquotes. but like I said, the commands do work when I don't try to release control to the calling script after the external executable is started. The lack of being able to do this is NOT a show stopper. Livecode has been able to let me create this monster kluge in very little development time and it works. -- Stephen Barncard - Sebastopol Ca. USA - mixstream.org On Tue, Feb 6, 2018 at 8:25 AM, Dr. Hawkins via use-livecode < use-livecode@lists.runrev.com> wrote: > On Mon, Feb 5, 2018 at 9:46 PM, Mike Bonner via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > > > (./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 > > KJAZ > > > ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' &) > > > > double quotes cause evaluation (for shell variables?), back quote (`) > causes contents to execute. You seem to be using ', which is a literal. > > Oh, I see. > > You have *SPACES* in file names. > > This *ALWAYS* leads to suffering. > > Quoting a filename does not make it ok; it's still multiple words. If you > want to keep such evil names, you'll have to escape those spaces with \ > (backslash). > > A better idea is to get all the spaces out of filenames. I only allow > letters, dot, and underscore. > > You also have hyphens, which have meaning on some operating systems. > > -- > Dr. Richard E. Hawkins, Esq. > (702) 508-8462 > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Mon, Feb 5, 2018 at 9:46 PM, Mike Bonner via use-livecode < use-livecode@lists.runrev.com> wrote: > > > (./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 > KJAZ > > ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' &) > double quotes cause evaluation (for shell variables?), back quote (`) causes contents to execute. You seem to be using ', which is a literal. Oh, I see. You have *SPACES* in file names. This *ALWAYS* leads to suffering. Quoting a filename does not make it ok; it's still multiple words. If you want to keep such evil names, you'll have to escape those spaces with \ (backslash). A better idea is to get all the spaces out of filenames. I only allow letters, dot, and underscore. You also have hyphens, which have meaning on some operating systems. -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Don't recall if anyone has already mentioned using open process but.. But.. If you build your known working string ( ./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav') and put it in a variable tCommand and then do.. open process tCommand for neither does it do what you want? On Mon, Feb 5, 2018 at 10:04 PM, Stephen Barncard via use-livecode < use-livecode@lists.runrev.com> wrote: > seriously, back on topic... > on mac -- El Capitan > calling shell > I have this open sourced app > > ffmpeg > > and I need to copy the first file from a CD, convert it to a wav file, name > it, and save it to a file on a hard drive. > (the executable is located in the same folder as the stack, hence the ./ ) > so my generated command used with the shell command is: > > *./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ > ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav'* > > this works fine, LC just doesn't return control until it's fully imported > the file off of the CD. > I just want to keep a simple counter going during the file import. > > I've tried these variations below without success. It's true, I get screwed > by syntax and quotes all the time, but I still have not found why these > won't work. Sometimes these will copy the file, but does not release until > done. > > ./ffmpeg -i "/Volumes/Audio CD/1 Audio Track.aif" "/Volumes/20160518 KJAZ > ARCHIVE MASTER/JULY - JAN 2017/20180204 TEST1.wav &" > > ./ffmpeg -i "/Volumes/Audio CD/1 Audio Track.aif" "/Volumes/20160518 KJAZ > ARCHIVE MASTER/JULY - JAN 2017/20180204 TEST1.wav" & > > (./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ > ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' &) > > thanks for any suggestions... you guys rock. > > sqb > > > > > > > > -- > Stephen Barncard - Sebastopol Ca. USA - > mixstream.org > > On Mon, Feb 5, 2018 at 2:43 PM, Dr. Hawkins via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > On Mon, Feb 5, 2018 at 2:18 PM, Mark Wieder via use-livecode < > > use-livecode@lists.runrev.com> wrote: > > > > > On 02/05/2018 12:02 PM, Dr. Hawkins via use-livecode wrote: > > > > > > disintegrated (and so did that plumber). > > >> > > > > > > !!! > > > > > > > > *shrug* > > > > So I'm a vengeful homeowner. > > > > :) > > > > -- > > Dr. Richard E. Hawkins, Esq. > > (702) 508-8462 > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
seriously, back on topic... on mac -- El Capitan calling shell I have this open sourced app ffmpeg and I need to copy the first file from a CD, convert it to a wav file, name it, and save it to a file on a hard drive. (the executable is located in the same folder as the stack, hence the ./ ) so my generated command used with the shell command is: *./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav'* this works fine, LC just doesn't return control until it's fully imported the file off of the CD. I just want to keep a simple counter going during the file import. I've tried these variations below without success. It's true, I get screwed by syntax and quotes all the time, but I still have not found why these won't work. Sometimes these will copy the file, but does not release until done. ./ffmpeg -i "/Volumes/Audio CD/1 Audio Track.aif" "/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20180204 TEST1.wav &" ./ffmpeg -i "/Volumes/Audio CD/1 Audio Track.aif" "/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20180204 TEST1.wav" & (./ffmpeg -i '/Volumes/Audio CD/1 Audio Track.aiff' '/Volumes/20160518 KJAZ ARCHIVE MASTER/JULY - JAN 2017/20040315-2-JD0211b.wav' &) thanks for any suggestions... you guys rock. sqb -- Stephen Barncard - Sebastopol Ca. USA - mixstream.org On Mon, Feb 5, 2018 at 2:43 PM, Dr. Hawkins via use-livecode < use-livecode@lists.runrev.com> wrote: > On Mon, Feb 5, 2018 at 2:18 PM, Mark Wieder via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > On 02/05/2018 12:02 PM, Dr. Hawkins via use-livecode wrote: > > > > disintegrated (and so did that plumber). > >> > > > > !!! > > > > > *shrug* > > So I'm a vengeful homeowner. > > :) > > -- > Dr. Richard E. Hawkins, Esq. > (702) 508-8462 > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Mon, Feb 5, 2018 at 2:18 PM, Mark Wieder via use-livecode < use-livecode@lists.runrev.com> wrote: > On 02/05/2018 12:02 PM, Dr. Hawkins via use-livecode wrote: > > disintegrated (and so did that plumber). >> > > !!! > > *shrug* So I'm a vengeful homeowner. :) -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 02/05/2018 12:02 PM, Dr. Hawkins via use-livecode wrote: disintegrated (and so did that plumber). !!! -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Sun, Feb 4, 2018 at 10:13 AM, prothero--- via use-livecode < use-livecode@lists.runrev.com> wrote: > Totally ot, > My mother in law had an iron drain deteriorate, with roots and cracks all > through it, and Roto Rooter was able to ream it and put in some kind of > epoxy liner, so nothing had to be dug up. > We had thought, from the video, that the bottom half of the iron pipe had disintegrated (and so did that plumber). It turned out that, no, that was the beginning of a blockage that grew to 100%. Petrified fat. Given what we know from going through the shower floor (last tenant poured concrete down the drain in spite), the pipes likely weren't at the proper angle to drain (a retired pipe-fitter friend could tell the shower wasn't angled right at a glance!). (Our house was built during the mob's heyday in Las Vegas, late 60s). -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
[OT] Re: any tricks to make SHELL non blocking?
On 2/4/18 12:13 PM, prothero--- via use-livecode wrote: Totally ot, My mother in law had an iron drain deteriorate, with roots and cracks all through it, Not totally off-topic. If you drop a large enough shell into a pipe it will be blocking. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Totally ot, My mother in law had an iron drain deteriorate, with roots and cracks all through it, and Roto Rooter was able to ream it and put in some kind of epoxy liner, so nothing had to be dug up. Bill William Prothero http://es.earthednet.org > On Feb 4, 2018, at 7:53 AM, Dr. Hawkins via use-livecode > wrote: > > On Sat, Feb 3, 2018 at 4:51 PM, J. Landman Gay via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> The Husband loves plumbing, it gives him the inspiration to learn all >> kinds of new colorful words. He puts it off as long as possible to savor >> the anticipation >> > > > There's nothing like the joy of going weeks of carting the water from the > kitchen sink down the hall, as it drains into a five gallon bucket, because > the sewer line is 100% blocked a couple of feet under the concrete slab > under the the living room. > > Not even the thrill of the redneck connection of a garden hose to the > washing machine to run down the driveway, or even the 2'x22' trench three > feet deep across the room that you get to step over for a couple of days > as the work is done and you wait for inspectors. > > On the bright side, we replaced with ABS rather than cast iron, so it > should last a touch longer, and even the same 50 years means i wont be here > when it happens . . . > > -- > Dr. Richard E. Hawkins, Esq. > (702) 508-8462 > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Sat, Feb 3, 2018 at 4:51 PM, J. Landman Gay via use-livecode < use-livecode@lists.runrev.com> wrote: > The Husband loves plumbing, it gives him the inspiration to learn all > kinds of new colorful words. He puts it off as long as possible to savor > the anticipation > There's nothing like the joy of going weeks of carting the water from the kitchen sink down the hall, as it drains into a five gallon bucket, because the sewer line is 100% blocked a couple of feet under the concrete slab under the the living room. Not even the thrill of the redneck connection of a garden hose to the washing machine to run down the driveway, or even the 2'x22' trench three feet deep across the room that you get to step over for a couple of days as the work is done and you wait for inspectors. On the bright side, we replaced with ABS rather than cast iron, so it should last a touch longer, and even the same 50 years means i wont be here when it happens . . . -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
The Husband loves plumbing, it gives him the inspiration to learn all kinds of new colorful words. He puts it off as long as possible to savor the anticipation. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On February 3, 2018 5:35:00 PM Mark Wieder via use-livecode wrote: On 02/03/2018 02:31 PM, Richard Gaskin via use-livecode wrote: If everyone would just get over themselves and start using Linux we could all enjoy named pipes. :) After working on our kitchen plumbing for the last few days, I've got a few choice names for pipes. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 02/03/2018 02:31 PM, Richard Gaskin via use-livecode wrote: If everyone would just get over themselves and start using Linux we could all enjoy named pipes. :) After working on our kitchen plumbing for the last few days, I've got a few choice names for pipes. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Paul Dupuis wrote: > FYI we found that interapp communication via sockets is more reliable > cross-platform that via interprocess communication, but at some real > world customer sites, security setting can prohibit socket > communication even to the same computer where as IPC still works, so > an app that need to be really really robust for real world installs > may wish to include code for both and swap from one to the other if > one means of communication fails. If everyone would just get over themselves and start using Linux we could all enjoy named pipes. :) But seriously, do you have a list of circumstances that prevent sockets on loopback? Personally, I'm inclined to consider it a bug if any software prevents IPC via loopback sockets, but there may be a good reason worth learning. And even if the reasoning turns out not to be good, it's useful to know about limitations imposed on otherwise-reliable mechanisms. -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On Fri, Feb 2, 2018 at 1:41 PM, Klaus major-k via use-livecode < use-livecode@lists.runrev.com> wrote: > > Any hints on how to make this NON blocking somehow? > I need a solution for Mac and Win. > > I don''t know about darkside machines, but on \begin{condescending snark} mac and other real operating systems \end{snark}, you can launch commands into the background by suffixing with & You may (or may not; it was years ago) need to enclose the command in parenthesis, which makes the whole parenthetical a block. You might also need to redirect output. so shell ( "(domycommand > myoutput &)" ) or something like that, and come back later to check myoutput -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
> Way cool, dude! > Voll krass, Alter! :-) Yes. I once was also a young man with curly hair -- like you. are now ... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Hi Hermann, > Am 03.02.2018 um 00:35 schrieb hh via use-livecode > : > >> Klaus wrote: >> ... it WORKS, thanks a lot! > > How could you doubt that!? :-( sorry, really didn't mean it personally! ;-) > I never post things that I didn't test thoroughly, learned that from 'bn'. > In this case I looked into the script of my next Mac/Win/Linux/Raspi-stack > "timeLapseCamera" which runs since four days without problems. > I have it running with up to 4 cheap USB-webcams at different repeat rates. > There is no blocking with my tests even if they fire all at the same full > second. Way cool, dude! Voll krass, Alter! :-) Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
> Klaus wrote: > ... it WORKS, thanks a lot! How could you doubt that!? :-( I never post things that I didn't test thoroughly, learned that from 'bn'. In this case I looked into the script of my next Mac/Win/Linux/Raspi-stack "timeLapseCamera" which runs since four days without problems. I have it running with up to 4 cheap USB-webcams at different repeat rates. There is no blocking with my tests even if they fire all at the same full second. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
On 2/2/2018 5:42 PM, Richard Gaskin via use-livecode wrote: > Paul Dupuis wrote: > > > I don't think you can use shell as non-blocking. You could use 'open > > process' to spawn your command line utility off as a subprocess which > > would be non blocking, but that approach has its own over head thing > > to work around > > What additional overhead is incurred by running a process via "open > process" vs the shell function? > Correction, I wasn't speaking of 'overhead' as CPU overhead, but as other things you may need to do as a developer. For example, shell() nicely runs the app specified and returns any return value, where as with 'open process' you need to also read from the process to get returned data, close the process. Any helper app you install that you call via open process (i.e. some app that is not already part of the OS or installed software), you really need to code sign (a good practice anyway) otherwise, assorted 3rd party security tools (mostly on Windows like McAfee or Norton) are likely to interfere with your launching of the app via open process by treating it as suspicious activity. There are probably a few other detail I have forgotten as I wrote this. We just went through this for a couple of HyperRESEARCH (our app) helper apps (also LC standalones) that 4.0 of HyperRESEARCH communicates with. FYI we found that interapp communication via sockets is more reliable cross-platform that via interprocess communication, but at some real world customer sites, security setting can prohibit socket communication even to the same computer where as IPC still works, so an app that need to be really really robust for real world installs may wish to include code for both and swap from one to the other if one means of communication fails. -- Paul ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Hi Hermann, > Am 03.02.2018 um 00:02 schrieb Klaus major-k via use-livecode > : > > Hi Hermann, > >> Am 02.02.2018 um 23:53 schrieb hh via use-livecode >> : >> >> This is non-blocking: >> >> put tCommandLineUtility && q(tGeneratedFile) into p0 >> open process p0 for neither -- no need to close that >> >> Don't use quotes for the utility. >> You have no feedback with that. That's the advantage of shell. > > just tested on my Mac, no luck. > And "the result" = EMPTY sorry, I had a typo in my script, it WORKS, thanks a lot! Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Hi Hermann, > Am 02.02.2018 um 23:53 schrieb hh via use-livecode > : > > This is non-blocking: > > put tCommandLineUtility && q(tGeneratedFile) into p0 > open process p0 for neither -- no need to close that > > Don't use quotes for the utility. > You have no feedback with that. That's the advantage of shell. just tested on my Mac, no luck. And "the result" = EMPTY >> Klaus M. wrote: >> Hi friends, >> I have a command line utility which will process a generated file like: >> ... >> get shell(q(tCommandLineUtility) && q(tGeneratedFile)) >> ... >> FYI: >> function q tString >> return QUOTE & tString & QUOTE >> end q >> Any hints on how to make this NON blocking somehow? >> I need a solution for Mac and Win. >> Thanks for any hint. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Hello Hermann, > Am 02.02.2018 um 23:53 schrieb hh via use-livecode > : > > This is non-blocking: > > put tCommandLineUtility && q(tGeneratedFile) into p0 > open process p0 for neither -- no need to close that > > Don't use quotes for the utility. > You have no feedback with that. That's the advantage of shell. great, thank you, will try this tomorrow! >> Klaus M. wrote: >> Hi friends, >> I have a command line utility which will process a generated file like: >> ... >> get shell(q(tCommandLineUtility) && q(tGeneratedFile)) >> ... >> FYI: >> function q tString >> return QUOTE & tString & QUOTE >> end q >> Any hints on how to make this NON blocking somehow? >> I need a solution for Mac and Win. >> Thanks for any hint. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Hi Phil, > Am 02.02.2018 um 23:30 schrieb Phil Davis via use-livecode > : > > Run it in a different app that you communicate with via sockets? Or maybe run > that app as a process? > You said *any* hints, so... be careful what you ask for! :-) yep, get it! :-D > Phil Davis > > On 2/2/18 1:41 PM, Klaus major-k via use-livecode wrote: >> Hi friends, >> I have a command line utility which will process a generated file like: >> ... >> get shell(q(tCommandLineUtility) && q(tGeneratedFile)) >> ... >> FYI: >> function q tString >> return QUOTE & tString & QUOTE >> end q >> >> Any hints on how to make this NON blocking somehow? >> I need a solution for Mac and Win. >> >> Thanks for any hint. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
This is non-blocking: put tCommandLineUtility && q(tGeneratedFile) into p0 open process p0 for neither -- no need to close that Don't use quotes for the utility. You have no feedback with that. That's the advantage of shell. > Klaus M. wrote: > Hi friends, > I have a command line utility which will process a generated file like: > ... > get shell(q(tCommandLineUtility) && q(tGeneratedFile)) > ... > FYI: > function q tString > return QUOTE & tString & QUOTE > end q > Any hints on how to make this NON blocking somehow? > I need a solution for Mac and Win. > Thanks for any hint. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Paul Dupuis wrote: > I don't think you can use shell as non-blocking. You could use 'open > process' to spawn your command line utility off as a subprocess which > would be non blocking, but that approach has its own over head thing > to work around What additional overhead is incurred by running a process via "open process" vs the shell function? -- Richard Gaskin Fourth World Systems ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
I don't think you can use shell as non-blocking. You could use 'open process' to spawn your command line utility off as a subprocess which would be non blocking, but that approach has its own over head thing to work around On 2/2/2018 4:41 PM, Klaus major-k via use-livecode wrote: > Hi friends, > > I have a command line utility which will process a generated file like: > ... > get shell(q(tCommandLineUtility) && q(tGeneratedFile)) > ... > > FYI: > function q tString > return QUOTE & tString & QUOTE > end q > > > Any hints on how to make this NON blocking somehow? > I need a solution for Mac and Win. > > Thanks for any hint. > > > Best > > Klaus > > -- > Klaus Major > http://www.major-k.de > kl...@major-k.de > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: any tricks to make SHELL non blocking?
Run it in a different app that you communicate with via sockets? Or maybe run that app as a process? You said *any* hints, so... be careful what you ask for! :-) Phil Davis On 2/2/18 1:41 PM, Klaus major-k via use-livecode wrote: Hi friends, I have a command line utility which will process a generated file like: ... get shell(q(tCommandLineUtility) && q(tGeneratedFile)) ... FYI: function q tString return QUOTE & tString & QUOTE end q Any hints on how to make this NON blocking somehow? I need a solution for Mac and Win. Thanks for any hint. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode