[UFFI-Users] accessing data in a structure that's inside another structure

Patrick X dabittweiler at gmail.com
Tue Feb 20 19:37:08 MST 2007


Forgive my ignorance,
I couldn't  find this in the archives anywhere so I thought I ask..

(defun get-stat (path)
  (uffi:with-cstring (cpath path)
   (uffi:with-foreign-object (sb 'stat)
    (if (zerop (c-stat cpath sb))
        (list (uffi:get-slot-value sb 'stat 'st_ino)
              (uffi:get-slot-value sb 'stat 'st_uid)
              (uffi:get-slot-value sb 'stat 'st_gid)
              (uffi:get-slot-value sb 'stat 'st_mtimespec)
              (uffi:get-slot-value sb 'stat 'st_ctimespec)
              (uffi:get-slot-value sb 'stat 'st_size))
         (error "Error stat() Failed!")))))

I know st_mtimespec and st_ctimespec are structures of timespec but I
trying to access the
timespec->tv_sec of both.  So, how do you normatlly get data that's in
a structure within a structure.  Everything else works properly.
Thanks

-- 
=================================
knot in cables caused data stream to become twisted and kinked.
http://groups.google.com/group/lispstl
http://www.cwelug.org/
Patrick Pippen


More information about the UFFI-Users mailing list