fileStream 
        "Answer the file stream with position set at the beginning of my string.
        Answer a read only copy to avoid syntax errors when accessed via
        multiple processes."

        | theFile |
        (sourceFileNumber == nil or: [(SourceFiles at: sourceFileNumber) == 
nil]) ifTrue: [^ nil].
        theFile := (SourceFiles at: sourceFileNumber) readOnlyCopy.
        theFile position: filePositionHi.
        ^ theFile

string 
        "Answer the receiver's string if remote files are enabled.
        Use a read only copy to avoid syntax errors when accessed via
        multiple processes."
        
        | theFile |
        (sourceFileNumber == nil or: [(SourceFiles at: sourceFileNumber) == 
nil]) ifTrue: [^''].
        theFile := (SourceFiles at: sourceFileNumber) readOnlyCopy.
        ^[theFile position: filePositionHi.
        theFile nextChunk] ensure: [theFile close]


text 
        "Answer the receiver's string asText if remote files are enabled.
        Use a read only copy to avoid syntax errors when accessed via
        multiple processes."
        
        | theFile |
        (sourceFileNumber == nil or: [(SourceFiles at: sourceFileNumber) == 
nil]) ifTrue: [^ nil].
        theFile := (SourceFiles at: sourceFileNumber) readOnlyCopy.
        ^[theFile position: filePositionHi.
        theFile position > theFile size ifTrue: [
                self error: 'RemoteString past end of file' ].
        theFile nextChunkText] ensure: [theFile close]

I imagine a good soul could fix that and nicely published in the inbox :)

Stef Did I say something negative about the past :)
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to