An issue with the "re_dot" quark

Salutations, dears!

Getting it short, I installed the “re_dot” quark and I’ve been facing this kind of error following the examples in the help folder: “ERROR: Primitive ‘_FileWrite’ failed”. Would you mind helping me? Hope not bother you all with this basic issue.

With assurances of my highest consideration,
Maia.

ERROR: Primitive ‘_FileWrite’ failed.
Failed.
RECEIVER:
Instance of File { (000000000CFB80C8, gc=F0, fmt=00, flg=00, set=02)
instance variables [1]
fileptr : nil
}
PATH: C:/Users/Maia/AppData/Local/SuperCollider/downloaded-quarks/rd_dot/help/draw.help.scd
CALL STACK:
MethodError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Object:primitiveFailed
arg this =
SynthDef:dot
arg this =
arg file =
Meta_DotViewer:draw
arg this =
arg synthDef =
var name = “/tmp/1507185478.dot”
var file =
var cmd = “/usr/local/bin/dotty”
var def =
Function:draw
arg this =
Interpreter:interpretPrintCmdLine
arg this =
var res = nil
var func =
var code = “{Pan2.ar(SinOsc.ar(440,0,0.1…”
var doc = nil
var ideClass =
Process:interpretPrintCmdLine
arg this =
^^ The preceding error dump is for ERROR: Primitive ‘_FileWrite’ failed.
Failed.
RECEIVER: a File

Hello Maia,

Are you on Linux?

IIUC, rd_dot is trying to write a temporary file in /tmp. Do you have write access to that folder?

Cheers,

m

“PATH: C:/Users/Maia/AppData/Local/SuperCollider/downloaded-quarks/rd_dot/help/draw.help.scd” points to Windows.

The dot extension was written before Windows compatibility was a consideration, and it hasn’t been updated.

So someone will need to fix it for Windows.

First thought is, it should use PathName.tmp instead of hardcoding the location.

hjh

“PATH: C:/Users/Maia/AppData/Local/SuperCollider/downloaded-quarks/rd_dot/help/draw.help.scd” points to Windows.

Ah, my bad. Totally missed that line.

The dot extension was written before Windows compatibility was a consideration, and it hasn’t been updated.

Interestingly, the quark makes reference to windows platform, but uses unix path there…

So yes, there are few things to fix (and test) for Windows there: at least the temp path definition as pointed out by hjh, as well as viewer path in DotViewer.

Marcin

Salutations, esteemed fellows!

In advance I really must thank you all for your solicitude.

As a sign of my gratitude for the attention given, let me share the solutions I came out with.

Firstly, for the method “.draw” I’ve set the path for the directory and edited the path in “DotViewer.sc” and make it point to my dotty.:

DotViewer.drawInputName = true;

DotViewer.directory= Platform.defaultTempDir;

DotViewer.viewer = "dotty";

[DotViewer.directory, DotViewer.viewer];

Secondly, for the method “.dot” I evoked the message " standardizePath", as in the examples bellow (with the generated “.dot” file, assuming that its name is “test”, I access the “command prompt” and change the file extention to “.png” with “dot -Tpng test.dot -o test.png”).

a= SynthDef(\ttestB, {Pan2.ar(SinOsc.ar(440,0,0.1),SinOsc.kr(1),1);}).add;
f= File.new("~/Desktop/ttestB.dot".standardizePath, "w");
a.dot(f);
f.close;

(
  a = SynthDef.new("Example", {
    arg bus=0, freq=440;
    var e, o;
    e = EnvGen.kr(Env.perc, levelScale:0.3, doneAction:2);
    o = RLPF.ar(LFSaw.ar(freq) * e,
                LFNoise1.kr(1, 36, 110).midicps,
                0.1);
    4.do({o = AllpassN.ar(o, 0.05, [0.05.rand, 0.05.rand], 4)});
    Out.ar(bus, o);
  });
  f = File.new("~/Desktop/Example.dot".standardizePath, "w");
  a.dot(f);
  f.close;
)