[Vm-dev] Adding new primitives to FilePlugin

David T. Lewis lewis at mail.msen.com
Fri Sep 23 12:40:19 UTC 2016


I suggest that you try this first by making your own plugin separate from FilePlugin.
If the idea proves useful in a general way, then consider adding it to FilePlugin.

FilePlugin is one of a small number of essential plugins that needs to be implemented
when bringing up a VM an a new platform, so it is generally a good idea to resist
the temptation to add features there.

>From your previous email regarding sqFileReadIntoAt(), I think that you have
already noticed some rather questionable features that have crept into this
plugin over the years ;-)

Dave


On Fri, Sep 23, 2016 at 10:40:15AM +0200, Holger Freyther wrote:
> 
> Good Morning,
> 
> with UFFI it is easy to call OS functions that return a filedescriptor (e.g. inotify, timerfd, kqueue) but it is then difficult to use it. Classes like AioEventHandler or AttachableFileStream need the fileID (SQFile) but currently there is no way to create a SQFile from a int/FILE*.
> 
> I would like to propose two new primitives:
> 
> 	>>#primitiveFileOpenUseFileDescriptor [1]
> 	>>#primitiveFileOpenUseFile [2]
> 
> and the first implementation[3]. What does it take to get this into the FilePlugin? 
> 
> regards
> 	holger
> 
> 
> 
> [1] https://github.com/zecke/pharo-vm/blob/dd74059acb55fc9e3da4756ff7a751adecce76e2/mc/VMMaker.oscog.package/FilePlugin.class/instance/primitiveFileOpenUseFileDescriptor.st
> 
> [2] https://github.com/zecke/pharo-vm/blob/dd74059acb55fc9e3da4756ff7a751adecce76e2/mc/VMMaker.oscog.package/FilePlugin.class/instance/primitiveFileOpenUseFile.st
> 
> [3] https://github.com/zecke/pharo-vm/commit/dd74059acb55fc9e3da4756ff7a751adecce76e2#diff-9bbe8b1dab4518d9de3cc7326295466bR296


More information about the Vm-dev mailing list