Strange Problem with the File Class

Hi all,

In a really simple program to compute statistics from a midi file I encounter a strange problem when trying to ope my midifile.

the problematic code is :

MidiFileName="mal19.mid"; File TheMidiFile (MidiFileName);

when executing this I get :

[quote]JUCE Assertion failure in /Users/sylvainclement/Documents/dev/c++/juce/build/macosx/…/…/src/juce_core/io/files/juce_File.cpp, line 173
Debugger() was called![/quote]

I’m on mac os x with sdk10.4. Juce as well as JuceDemo and jucer compiled and run without any problem. I don’t understand what is happening here…

Any hints ?

Sylvain Clément

The File class wants a complete path, not just a filename. If you give it just a filename, it’ll use the current directory as well as giving an assert.

An assertion is juce telling you that you’ve goofed. If you actually look at the line of code where the assertion is, you’ll probably find that I’ve left a helpful comment there to explain what you’re doing wrong…

Thanks !

I didn’t thought about looking at the juce_file.cpp… Everything is here. I was not aware of this “assert” signals…

Thanks to both of you !!!
Sylvain