[Etoys] SugarDataStore>>getFilename: problem

karl ramberg karlramberg at gmail.com
Tue Dec 30 06:50:27 EST 2008


Bogus jpeg entries was indeed the problem. Thanks.

I had some problems with SugarDatastoreDirectory>>entries by the way.
Shouldn't it be at:'title' asString only without the changing of back
slash to forward slash ?

Karl

On 12/30/08, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On 30.12.2008, at 00:44, karl ramberg wrote:
>
>> Hi,
>> I've been trying to get jpegs loaded from datastore but keep getting
>> errors with SugarDataStore>>getFilname:id. I use this code:
>>
>> store := SugarDataStore new.
>> list := (store find:{'mime_type'->#('application/x-squeak-project'
>> 'image/jpeg')} with:#('uid')).
>> id := ((list at:1) at:'uid') asString.
>> store getFilename: id.
>>
>> I can test different entries in the journal changing 'list at:1' to
>> different numbers. Problem is that the Squeak projects return a file
>> path but jpegs return only ''
>>
>> Does anybody have a suggestion ?
>
>
> It's a simple typo I assume - list is an array of 2 elements, the
> second is the total number of items, the first is an array of
> dictionaries for each entry. Your code should look like
>
>    list := (store find: ... with: ...) first.
>
> With that change it works fine here (and the #asString send is not
> even needed).
>
> If it does not then maybe your jpeg journal entries indeed do not have
> files in them? Can you open them in another activity?
>
> - Bert -
>
>
>



More information about the etoys-dev mailing list