[PD] Pd Function to Create a File relative to canvas was: Cross platform path for externals ?

Miller Puckette via Pd-list pd-list at lists.iem.at
Mon Jun 30 07:40:42 CEST 2014


You probably want to call  canvas_makefilename(), supplying the owning canvas,
not a new one.  YOu can get the owning canvas using canvas_getcurrent(), 
but only when the object is being created (the information is not kept so
your object needs to keep it itself).  For a simple example, search
pd/extra/bink~/bonk~.c for x->x_canvas - it gets intialized in the new()
methnd and used both to create and read files.

cheers
Miller

On Sun, Jun 29, 2014 at 05:49:23PM -0500, Jaime E Oliver via Pd-list wrote:
> Hi all, 
> 
> Checking out  canvas_open inside g_canvas.c, I realize that this is a function to open a file that already exists, while what I am trying to do is write a file with a path that is relative to the canvas. I couldn't find something similar, such as canvas_write or such.
> 
> thanks again!
> 
> J
> 
> 
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list



More information about the Pd-list mailing list