musikinformatik/SuperDirt

ERROR: Primitive '_FilePos' failed when using SimpleMIDIFile.read(pathName)

BroCorra opened this issue · 3 comments

Hi everyone, I'm using Supercollider 11.2 in Windows 10.
I have the right extensions required form the official documentation, in the following folder:
...\AppData\Local\SuperCollider\Extensions\SC3plugins

Every time I call the SimpleMIDIFile class I get the following error:

`ERROR: Primitive '_FilePos' failed.
Failed.
RECEIVER:
Instance of File {    (000001FCE7C4EB08, gc=A8, fmt=00, flg=00, set=02)
  instance variables [1]
    fileptr : nil
}
CALL STACK:
	MethodError:reportError
		arg this = <instance of PrimitiveFailedError>
	Nil:handleError
		arg this = nil
		arg error = <instance of PrimitiveFailedError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of PrimitiveFailedError>
	Object:throw
		arg this = <instance of PrimitiveFailedError>
	Object:primitiveFailed
		arg this = <instance of File>
	SimpleMIDIFile:read
		arg this = <instance of SimpleMIDIFile>
		var file = <instance of File>
		var time = nil
	< closed FunctionDef >  (no arguments or variables)
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "m = SimpleMIDIFile.read("C:/..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Primitive '_FilePos' failed.
Failed.
RECEIVER: a File`

What could be the problem?

can you check if your file exists?

File.exists("your\path\to\the\file")

Thanks for this, actually the probem was related by the fact that the file was somehow unaccessible. I suggest the ones who have this issue to check the file permissions.

thanks @telephon

welcome!