[PD] A way to query the current platform

IOhannes m zmölnig zmoelnig at iem.at
Wed Sep 24 09:05:32 CEST 2014


On 09/24/2014 06:15 AM, Chris McCormick wrote:
> Hi Miller,
> 
> Now that Pd is running on diverse platforms and variants, it would be

finally!
t
> very useful to have a generic interface that a patch can use to query
> the current platform. Something like sending a "getinfo" message to the
> pd object which would send back e.g.:

iirc, there was [operating_system] in zexy.
it doesn't do everything you want (actually, it doesn't do most), but
iirc it has not been touched since the advent of Pd-on-OSX.

> 
> The use-case for this is things like:
> 
>  * On Android, audio latency is high and needs to be factored in by patches.

but on android you are most likely using libpd and therefore have yet
another wrapper that actually sets the latency (hopefully to something
useable).

> 
>  * A patch that wants to load a text file might need to use a different
> path delimiter on linux versus windows.

why would you want to do that?
even microsoft allows using forward slashes in fopen()/open() and in any
case, Pd (sh)would do any necessary conversion on the C-level (that is:
you tell [textfile] to open "foo/bar.txt" and it will convert it to
"foo/bar.txt", "foo\bar.txt" or "foo:bar.txt" depending on whatever is
required to open the file.
the patch doesn't need to know at all.

> What are your thoughts on this?

so i think that the primary goal should be to make this functionality
unneccessary:
   a patch should run on *all* implementations of Pd, without adapting
it's behaviour.
platform specific quirks to guarantee consistent behaviour through all
platforms are in the realm of the implementation of the interpreter.

having said that, i still see the need for that functionality and
support the idea for such an object (after all, that's why i wrote
[operating_system], though i cannot remember having used it _ever_).

though the output shall be uniform, an dwe need much more info, like
ptr-size and whatnot.
something like [uname], with some Pd-specifics like flavour, and *version*.

and i think we should go for messages that only report a single thing,
rather than outputting long lists (that keep growing the more system
information we want to add).

[version, flavour, os(
|
[uname]
|
[route version flavour os]
|      |           |
[0.46\ |           |
       |           |
       [vanilla\   |
                   [freeBSD\


gfmrds
IOhannes

PS: so what's the OS on Debian/kFreeBSD?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140924/dcbb16da/attachment.sig>


More information about the Pd-list mailing list