Quantcast

non absolute path with thisProcess.nowExecutingPath on a standalone version under OSX

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

non absolute path with thisProcess.nowExecutingPath on a standalone version under OSX

altern2
hi

When I run  thisProcess.nowExecutingPath from a file that it is located
inside the SCClassLibrary of a standalone version of supercollider the
returning path is not absolute

on mac it returns SCClassLibrary/myfolder

instead of
/Users/XXX/Documents/MYAPP.app/Contents/Resources/SCClassLibrary/myfolder

on windows I get the same result, it does not return the absolute path.

any other method I would use to get the current absolute path of a file
that lives in such conditions?

thanks

enrike

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: non absolute path with thisProcess.nowExecutingPath on a standalone version under OSX

Eirik Arthur Blekesaune-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: non absolute path with thisProcess.nowExecutingPath on a standalone version under OSX

altern2
it is a scd file, no class involved

I ended up ~solving it this way, but havent tested it on mac yet. on
windows it seems to work fine. at least on my machine running W7

Platform.case(
        \linux,   { path = thisProcess.nowExecutingPath.dirname },
        \osx,     {
                path = "cwd".unixCmdGetStdOut;
                path = path[..path.size-2];// get rid char return
                },
        \windows, {
                path = "ECHO %CD%".unixCmdGetStdOut;
                path = path[..path.size-2];// get rid of char return
                }
        );


og., 2017.eko mairen 11a 08:46(e)an, [hidden email] igorleak
idatzi zuen:
> Does it do the same if you use Class.filenameSymbol instead?  As a
> reference:
> http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Document-s-current-path-SCIDE-equivalent-td7602848.html#a7602851
> +Eirik
> ​


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...