<div dir="ltr"><div><div><div><div>Perfect IOhannes!<br><br></div>It works! Thanks for the explanation.<br><br></div>Let me finish the patch and I will post it here with a better description of the problems and solutions.<br><br></div>All the best<br><br></div>Luiz Naveda<br><div class="gmail_extra"><br clear="all"><div><div>Luiz Naveda<br>_____________________________________________________<br></div><div><a href="http://naveda.info">naveda.info</a><br></div><div><br>                                      ^v^          <br>      ^v^          <br>                         ^v^          <br><br>^~^~^~^~^~^~^~^~~^~~^~~^~^~^~~~^^~^~~~~<br>^~^~^~^~^~^~^~^~^~^~~^~~^~~^~^~^~~~^~~~</div></div>
<br><div class="gmail_quote">On Sun, May 10, 2015 at 3:02 PM, IOhannes m zmölnig <span dir="ltr"><<a href="mailto:zmoelnig@iem.at" target="_blank">zmoelnig@iem.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 05/10/2015 06:35 PM, Luiz Naveda wrote:<br>
> Dear List,<br>
><br>
> I am trying to write a txt with pdlua (using pdluax) in a Mac (yosemite)<br>
> Everything is clear but I can't solve a permission error:<br>
><br>
> lua: error in dispatcher:<br>
> [string "txtwrite.pd_luax"]:11: example.txt: Permission denied<br>
<br>
</span>that should be unrelated to pdlua.<br>
<br>
the problem is, that you do not really know *where* on the filesystem<br>
you are writing the file.<br>
contrary to what you might expect (e.g. besides the "problem.pd" patch),<br>
a simple call to `open()` (and lua's io.open() is just a thing wrapper<br>
around the underlying C-function) will create a file in the working<br>
directory of the calling application - which is determined at startup to<br>
the place where you started Pd from.<br>
since you are on OSX, i assume that you are starting Pd from simply<br>
clicking on the application icon, which IIRC uses the filesystem root<br>
(`/`) as your working directory (at least some older versions of Pd,<br>
probably including Pd-extended).<br>
<br>
now in general it's a good thing that you are not allowed to write stuff<br>
in `/`.<br>
the fix is rather easy: provide full pathnames when using low-level file<br>
io-functions. for testing it might be a good idea to use a tempdir, e.g.<br>
/tmp/example.txt<br>
<br>
gfdsar<br>
<span><font color="#888888">IOhannes<br>
<br>
</font></span><br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div></div>