[of-dev] ofDirectoryLister

Theodore Watson theo at openframeworks.cc
Thu Apr 14 05:24:45 PDT 2011


well it will definately work by putting a check inside of ofToDataPath

	ie 

ofToDataPath( string path, bool absolute ){
	if( !execPathChecked ){
		makeExecPath();
	}
}

also the initApp method arturo was referring too would be called before testApp is constructed. 
so both should be workable options.

----------------------------------------------
Theo Watson
http://theowatson.com 
http://openframeworks.cc
----------------------------------------------

On 14 Apr 2011, at 02:13, Diederick Huijbers ☾ Apollo wrote:

> Not sure, because also when I create a class, lets say "MyVideoLoader" and
> in the constructor of that class I  use ofToDataPath() and then create a member
> of this class in testapp it will call the c'tor of MyVideoLoader before setup(). 
> 
> I had a workaround which I'll try to find... it was ugly but worked.
> 
> 
> Best,
> Diederick
> 
> On Apr 13, 2011 (16), at 11:19 PM, arturo castro wrote:
> 
>> i guess this could get solved with the new initApp function?
>> 
>> El mié, 13-04-2011 a las 16:56 -0400, Theodore Watson escribió:
>>> Hi Diederick, 
>>> 
>>> 
>>> Not sure if there is an easy fix for this as we don't know the actual
>>> correct executable_path of the app until after ofAppRunner has done
>>> its thing. 
>>> Maybe one solution could be to include a call inside ofToDataPath that
>>> would check if the path has been set yet?
>>> 
>>> 
>>> T
>>> 
>>> 
>>> ----------------------------------------------
>>> Theo Watson
>>> http://theowatson.com 
>>> http://openframeworks.cc
>>> ----------------------------------------------
>>> 
>>> On 13 Apr 2011, at 14:55, Diederick Huijbers ☾ Apollo wrote:
>>> 
>>>> While we're at it...I noticed a couple of weeks ago
>>>> ofToDataPath("file",true) returns 
>>>> an incorrect path when used before setup() has been called.  I
>>>> created an issue for this. 
>>>> 
>>>> 
>>>> Best, 
>>>> Diederick 
>>>> 
>>>> 
>>>> On Apr 13, 2011 (16), at 8:43 PM, arturo castro wrote: 
>>>> 
>>>>> yes, i was going to ask you about that but then totally forgot. do
>>>>> we
>>>>> need the absolute path parameter at all?  ofToDataPath is smart
>>>>> enough
>>>>> now to detect if a path is absolute or not.
>>>>> 
>>>>> El mié, 13-04-2011 a las 21:41 +0300, Kyle McDonald escribió: 
>>>>>> just noticed another regression. this line inside listDir()
>>>>>> shouldn't
>>>>>> be commented out:
>>>>>> 
>>>>>> directory = ofFilePath::getPathForDirectory(directory);
>>>>>> 
>>>>>> it is responsible for fixing missing trailing slashes.
>>>>>> 
>>>>>> the other lines that have been commented out are important too.
>>>>>> they
>>>>>> ensure that the paths you get from getPath() are correct
>>>>>> regardless of
>>>>>> whether you're using absolute or relative paths.
>>>>>> 
>>>>>> i can fix it, but arturo it looks like you're still working on
>>>>>> it? (i
>>>>>> see a debug cout just hanging around)
>>>>>> 
>>>>>> sorry if i didn't leave enough comments in the code to make this
>>>>>> part obvious :)
>>>>>> 
>>>>>> kyle
>>>>>> 
>>>>>> On Wed, Apr 13, 2011 at 5:31 PM, Kyle McDonald
>>>>>> <kyle at kylemcdonald.net> wrote:
>>>>>>> wow, just ran into this problem and read arturo's message more
>>>>>>> carefully.
>>>>>>> 
>>>>>>> this is great. ofxDirList is now really integrated into OF,
>>>>>>> not just
>>>>>>> as a weird appendage sitting in the core...
>>>>>>> 
>>>>>>> this does cause at least one issue with an easy fix:
>>>>>>> 
>>>>>>> https://github.com/openframeworks/openFrameworks/issues/537
>>>>>>> 
>>>>>>> also, i don't know if everyone realizes how awesome this is.
>>>>>>> read
>>>>>>> arturo's code snippet again. i'm so happy i don't have to try
>>>>>>> explaining what ios_base::out means anymore.
>>>>>>> 
>>>>>>> kyle
>>>>>>> 
>>>>>>> On Mon, Apr 11, 2011 at 10:47 PM, arturo castro
>>>>>>> <arturo at openframeworks.cc> wrote:
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> it's integrated into ofDir now. we've split ofFileUtils
>>>>>>>>> into ofFile +
>>>>>>>>> ofDir and merged ofDirectoryLister with ofDir :S
>>>>>>>> 
>>>>>>>> sorry ofDirectory
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> of-dev mailing list
>>>>>>>> of-dev at dev.openframeworks.cc
>>>>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>>>> 
>>>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> of-dev mailing list
>>>>> of-dev at dev.openframeworks.cc
>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>> 
>>>> 
>>>> Apollo +++++++++ 
>>>> Interactive Media
>>>> +++++++++++++++ 
>>>> Diederick Huijbers === 
>>>> diederick at apollomedia.nl
>>>> ==================== 
>>>> Zeeburgerpad 74 ::::::::
>>>> 1019 AD Amsterdam 
>>>> mobile 06 - 12 44 09 22
>>>> phone 020 - 707 78 96 
>>>> //\\//\\//\\//\\//\\//\\//\\//\\//\\ 
>>>> www.apollomedia.nl +++ 
>>>> ++++++++++++++++
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> of-dev mailing list
>>>> of-dev at dev.openframeworks.cc
>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc 
>>> 
>>> 
>>> _______________________________________________
>>> of-dev mailing list
>>> of-dev at dev.openframeworks.cc
>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>> 
>> 
>> _______________________________________________
>> of-dev mailing list
>> of-dev at dev.openframeworks.cc
>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
> 
> Apollo +++++++++ 
> Interactive Media
> +++++++++++++++ 
> Diederick Huijbers === 
> diederick at apollomedia.nl
> ==================== 
> Zeeburgerpad 74 ::::::::
> 1019 AD Amsterdam 
> mobile 06 - 12 44 09 22
> phone 020 - 707 78 96 
> //\\//\\//\\//\\//\\//\\//\\//\\//\\ 
> www.apollomedia.nl +++ 
> ++++++++++++++++
> 
> 
> 
> _______________________________________________
> of-dev mailing list
> of-dev at dev.openframeworks.cc
> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://dev.openframeworks.cc/pipermail/of-dev-openframeworks.cc/attachments/20110414/ffa01aa3/attachment-0003.htm>


More information about the of-dev mailing list