[Seaside] File Directory error (Pharo 1.2.1)

Philippe Marschall philippe.marschall at gmail.com
Tue Jul 12 19:27:59 UTC 2011


2011/7/12 dtrussardi at tiscali.it <dtrussardi at tiscali.it>:
>
>>> My environment is based on Pharo 1-0 and Seaside 3.0.0-alpha5.15,  run on
>>> MacBook.
>>> When i work with File Library   addAllFilesIn: addFileAt: methods
>>> the system erase the error:
>>> MessageNotUnderstood: receiver of "binary" is nil
>>> Relative specific method is
>>> contentsOfFile: aString binary: aBoolean | stream | stream := aBoolean
>>> ifTrue: [ (FileDirectory default oldFileNamed: aString) binary; yourself ]
>>> ifFalse: [ (MultiByteFileStream oldFileNamed: aString) ascii;
>>> wantsLineEndConversion: true; yourself ]. ^[ stream contents ] ensure: [
>>> stream close ].
>>>
>>> I think is the same problem relative to FileDirectory .
>>> Any idea for  solve the problem ?
>>
>> Can you experiment at bit? If you do
>> FileDirectory default oldFileNamed: aString
>> what do you get? Does the file actually exist?
>
>
> OK,
>
>        in the default directory ( ....../Contents/Resources)  i have 2 file.

Uhm, you're using a "OneClick"-image, right? The whole file io and
resources have never been tested on those.

>        datiSocietary.sixx
>
>        cerchio30.jpg
>
>
> FileDirectory default oldFileNamed: 'datiSocietari.sixx'
>
>        answer an :              MultiByteFileStream: '/users/dtr/GemTools-1.0b6.app/Contents/Resources/datiSocietari.sixx'
>
>
> FileDirectory default oldFileNamed: 'cerchio30.jpg'
>
>        answer          nil

Ok‽ That looks more like a Pharo issue to me. What does the following answer?
FileDirectory default entries
Can step through the code an check if something differently happens?
There are no white spaces or non-ascii characters in the file names
involved, are there?

> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
> File Library notes
>
> A) when  i do the               WAFileLibrarySubclass   addAllFilesIn:   '/Dati-IST/ISTWork/ImmaginiBase'
>
> the method  do loop on files in the path .
>
>        addAllFilesIn: aPathString
>        "adds all files in the directory specified by aPathString to the current file library"
>
>        **** THIS LOOP WORK FINE.  The files  exist. ****
>        (GRPlatform current filesIn: aPathString) do: [ :each | self addFileAt: each ]
>
> B) The error is in the action  do on the specific interaction:
>
>        addFileAt: aPath
>        "adds the file specified by aFilename to the current file library"
>        self
>                addFileAt: aPath
>                contents: (GRPlatform current
>                                contentsOfFile: aPath
>                                binary: (self isBinaryAt: aPath))

Can you try that outside of a OneClick image and see whether it works there?

Cheers
Philippe


More information about the seaside mailing list