cross platform OS-level commands

Apr 12, 2007 at 4:55pm

cross platform OS-level commands

I currently am using mxj within a Pluggo to do some specific OS-level things:

1) Make a directory
2) Retrieve path to current user’s home directory

With mxj and Java, this works nicely in a platform-independent way.

My question: is there a way I can perform these tasks without
reliance on Java? I know about Bill Orcutt’s shell, but that’s OS X
only. And it looks like Francois Eudes’ DOSHack for Windows is based
on mxj (though I see some reference to a C version??)

Thanks,
Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#31346
Apr 15, 2007 at 7:09pm

Any ideas??

At 12:55 PM -0400 4/12/07, Dan Nigrin wrote:
>I currently am using mxj within a Pluggo to do some specific OS-level things:
>
>1) Make a directory
>2) Retrieve path to current user’s home directory
>
>With mxj and Java, this works nicely in a platform-independent way.
>
>My question: is there a way I can perform these tasks without
>reliance on Java? I know about Bill Orcutt’s shell, but that’s OS X
>only. And it looks like Francois Eudes’ DOSHack for Windows is
>based on mxj (though I see some reference to a C version??)
>
>Thanks,
>Dan


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#101720
Apr 16, 2007 at 8:06am

#101721
Apr 16, 2007 at 11:48am

#101722
Apr 17, 2007 at 7:44am

#101723
Apr 17, 2007 at 6:53pm

#101724
Apr 19, 2007 at 7:47am

Dan Nigrin schrieb:
> ; max launchbrowser file:///Applications/Utilities/Terminal.app (Mac)
> or
> ; max launchbrowser “file://C:/Program Files/Cycling ’74/MaxMSP
> 4.6/max.exe” (Windows)
>
> But no hope of passing arguments with it… too bad!!

Usually there is no need to pass arguments, as on the easy operating
system level users double click a file and never pass arguments. If you
point to a file (not an application) it will open its associated
application: xxx.pdf will open the assigned PDF reader and xxx.pat will
eventually open Photoshop… ;-)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#101725
Apr 19, 2007 at 7:57am

#101726
Apr 19, 2007 at 11:24am

>>; max launchbrowser file:///Applications/Utilities/Terminal.app (Mac)
>>or
>>; max launchbrowser “file://C:/Program Files/Cycling ’74/MaxMSP
>>4.6/max.exe” (Windows)
>>
>>But no hope of passing arguments with it… too bad!!
>
>Usually there is no need to pass arguments, as on the easy operating
>system level users double click a file and never pass arguments. If
>you point to a file (not an application) it will open its associated
>application: xxx.pdf will open the assigned PDF reader and xxx.pat
>will eventually open Photoshop… ;-)

Thanks Stefan – but you forget what my original tasks are:

1) Make a directory
2) Retrieve path to current user’s home directory

I think you’ll agree that I’ll need to pass some arguments to an app
to be able to do those things…

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#101727
Apr 19, 2007 at 8:01pm

what about mkdir by bill orcutt, and possibly getenv by Jasch?

#101728
Apr 19, 2007 at 10:04pm

At 1:01 PM -0700 4/19/07, jamez wrote:
>what about mkdir by bill orcutt

Would’ve been perfect, but no UB Mac version available to my
knowledge. In general Bill, are any of your Mac objects UB yet??

>and possibly getenv by Jasch?

The Mac version is dependent on shell, which again, is not UB yet I think…

Thanks nonetheless for the suggestions…

Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#101729
Apr 20, 2007 at 7:03am

f.e schrieb:
> Yes, but he needs to do “; max launchbrowser cmd.exe /a /c rm c:temp”,
> and it would be great he could.

does cmd.exe understand scripts? maybe its possible to write a script
and then call this script which would then call cmd.exe…

In general all parameter passing to applications is part of a shell
culture. And thus it will be platform/shell specific always…
But it should be possible to create something like a shell command
translator, which creates a script file which can be called by
launchbrowser…
Is there an extension which is assigned to cmd.exe on windows?

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#101730
Apr 20, 2007 at 9:04am

#101731
Apr 20, 2007 at 12:51pm

Interesting though guys, I’ll give it a look.

I may have found a workaround in the meantime anyway; one of my
primary reasons in wanting to move away from the Java-based solution
that I already use (and which works well), is that on Win I can’t
guarantee that there will be a Java environment on hand for my
apps/plugins that I distribute. Relying on end-users to do so is
asking for trouble, IMHO.

So what I may do is use Windows-specific externals like mkdir and
getenv, and then on the Mac side, stick with Java (since it’s by
default in OS X).

Less elegant, but workable.

Dan

At 11:04 AM +0200 4/20/07, f.e wrote:
>For sure. On Win box, Dan could write a simple text file saved as
>.bat, then launch it from Max. Not sexy, but probably working.


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#101732
Apr 20, 2007 at 1:32pm

if you like, you could try my new [getpaths] on OS X and [getenv] on XP

http://www.jasch.ch/dl/beta/getpaths_20070420.zip

cheers

/*j

On 20/04/2007, at 14:51:28, Dan Nigrin wrote:

> Interesting though guys, I’ll give it a look.
>
> I may have found a workaround in the meantime anyway; one of my
> primary reasons in wanting to move away from the Java-based
> solution that I already use (and which works well), is that on Win
> I can’t guarantee that there will be a Java environment on hand for
> my apps/plugins that I distribute. Relying on end-users to do so
> is asking for trouble, IMHO.
>
> So what I may do is use Windows-specific externals like mkdir and
> getenv, and then on the Mac side, stick with Java (since it’s by
> default in OS X).
>
> Less elegant, but workable.
>
> Dan
>
> At 11:04 AM +0200 4/20/07, f.e wrote:
>> For sure. On Win box, Dan could write a simple text file saved
>> as .bat, then launch it from Max. Not sexy, but probably working.
>
> —
> Dan Nigrin
> Defective Records
> 202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X /
> Major Malfunction
> http://www.defectiverecords.com
> http://www.jackosx.com
>

#101733
Apr 20, 2007 at 1:51pm

Very nice Jasch, will take a look.

I presume your “_” object/abstraction is just “prepend set”?

Thanks,
Dan

At 3:32 PM +0200 4/20/07, jasch wrote:
>if you like, you could try my new [getpaths] on OS X and [getenv] on XP
>
>http://www.jasch.ch/dl/beta/getpaths_20070420.zip
>
>cheers
>
>/*j


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com

#101734
Apr 20, 2007 at 2:16pm

x-actly

> I presume your “_” object/abstraction is just “prepend set”?

#101735

You must be logged in to reply to this topic.