I'm wondering if anyone has coded up the FFI for doing a unix stat command? If so could they share it?
-- = = = ======================================================================== John M. McIntosh johnmci@smalltalkconsulting.com Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com = = = ========================================================================
On Thu, Jan 03, 2008 at 02:29:37AM -0800, John M McIntosh wrote:
I'm wondering if anyone has coded up the FFI for doing a unix stat command? If so could they share it?
It's not FFI, but just in case you had not noticed it, you can do this:
OSProcess accessor fileStat: '/bin/su'
The result is an array of stat() information, or an error string derived from errno via strerror(). It's not the complete contents of the stat structure though, see method comment of #primFileStat: for details.
Also note that FFI is not yet working for 64bit host Linux (e.g. Linux on AMD 64). Does it work on OS X?
Dave
On Jan 3, 2008, at 5:09 AM, David T. Lewis wrote:
Also note that FFI is not yet working for 64bit host Linux (e.g. Linux on AMD 64). Does it work on OS X?
nope. A bit of assembler work in the
/* x86-sysv-asm.S -- 386 FFI trampoline for SVr4-like ABIs -*- asm -*-
well and C work too.
-- = = = ======================================================================== John M. McIntosh johnmci@smalltalkconsulting.com Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com = = = ========================================================================
On Thu, Jan 03, 2008 at 01:46:07PM -0800, John M McIntosh wrote:
On Jan 3, 2008, at 5:09 AM, David T. Lewis wrote:
Also note that FFI is not yet working for 64bit host Linux (e.g. Linux on AMD 64). Does it work on OS X?
nope. A bit of assembler work in the
/* x86-sysv-asm.S -- 386 FFI trampoline for SVr4-like ABIs -*- asm -*-
well and C work too.
The FFIPlugin will need updates in addition to the support code. There are a fair number of casts between 64-bit machine addresses and 32-bit sqInt. I've been looking into this recently and will report back if I make any kind of progress.
I don't have a clue how to write the stack frame setup in assembler, but Andreas wrote the any-libffi.c that seems like it should work fine if I can sort out the type casting problems. If you or someone else knows how to do the assembler bits, that would be a good thing too.
Dave
squeak-dev@lists.squeakfoundation.org