A quick question about file URLs
m.rueger at acm.org
Tue Nov 15 09:56:38 UTC 2005
John M McIntosh wrote:
> However for the record
> 'file:///test1.txt' asURI retrieveContents
> gives me a DNU on nil
which is "correct"
| file |
file _ [self contentStreamForURI: uri]
on: FileDoesNotExistException do:[:ex| ex return: nil].
file ifNotNil: [^MIMEDocument contentStream: file mimeType: (MIMEType
forExtension: uri extension)].
the question is though if we should actually catch the file exception at
that point. Which I think we shouldn't.
> 'file://test1.txt' asURI retrieveContents
> returns the directory records content for root, *that is interesting*.
Hmm, the above uri is actually pointing to a host "test1.txt", not to a
'file:///test1.txt' does, namely to test1.txt in the root directory.
More information about the Squeak-dev