[IDEA]Central file management by .ext / mime-type.

Stephane Ducasse ducasse at iam.unibe.ch
Sun May 4 08:28:59 UTC 2003


Hi sean

I think that this is a good idea to have such a manager (but not in 
Utilities ;))))
go ahead and let us see.

I'm happy that the filelist simple architecture worked well and indeed 
hardcoding all these extensions has never been good.

Stef


On Saturday, May 3, 2003, at 11:45 PM, Sean Charles wrote:

> In a nutshell: A file manager object that can know of all file types 
> and be THE single point of contact for creating filenames, management 
> blah blah blah...
>
> 	FooMgr mimeTypeFor: aString.
> 	FooMgr extensionsFor: aMimeType.
> 	FooMgr servicesFor: etc etc etc
>
> I'm sure you guys get the idea. Is there something near to it / 
> planned already?
>
> Having just submitted a small enhancement cs, I spent some time 
> rummaging around and it seems that, in general, file handling by 
> extension is a bit rough around the edges. Although the FileList / 
> SimpleServiceHandler mechanism is great (I use it a lot for various 
> utilities I've written where I drop things from the Finder into Squeak 
> and it munges them as required) the actual implementation code seems 
> to use a lot of scattered, hardcoded file extensions which sometimes 
> leads to hit and miss operation.
>
> The initial source of my troubles was Morph>>exportAsJPEG which tacked 
> '.jpeg' onto the filename, I could have changed it by why should I 
> have to every time? The simple hack is changing it here I guess but I 
> never do things the easy way. It was a surprise to see that Scamper 
> wouldn't recognise .jpeg files resulting in a call to > displayImagePage.
>
> I'd consider changing .jpeg to .jpg as it is the more common 
> extension, and more to the point, recognised by FileList out of the 
> box unlike .jpeg.
>  You can save em but you can't get em back! *8-). Possibly a moot 
> point this one as most external programs should handle either 
> extension. If not,
>  ditch it!
>
>
> Interestingly enough, we have the *raw* beginning of something in 
> Utilities class>>graphicsFileSuffixes which, to save you looking, is:
>
> graphicsFileSuffixes
> 	"Answer a list of filename suffixes which signal file content which 
> we are able to internalize"
>
> 	^#('.gif' '.bmp' '.jpg' '.jpeg' '.jpe', '.form')
>
> In my image, it's called twice! I also note that .jpe is given, which 
> is also notoriously flaky too. I jut didn't bother with that as I've 
> never seen one ever!
>
> Sean Charles.
>
>
>
>
Prof. Dr. Stephane DUCASSE  	[ | ]
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you
  do different? ...  especially if,  by doing something different,
  today might not be your last day on earth" Calvin&Hobbes

Open Source Smalltalks: http://www.squeak.org, 
http://www.gnu.org/software/smalltalk/smalltalk.html
Free books for Universities at 
http://www.esug.org/sponsoring/promotionProgram.html
Online Free Books at 
http://www.iam.unibe.ch/~ducasse/WebPages/FreeBooks.html



More information about the Squeak-dev mailing list