³ò
Š’oLc           @   sŽ  d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d e _ h  d d <d d <d	 d
 <d d <Z
 e e i ƒ o^ e i d oP e i i e i d ƒ o6 e i i e i d ƒ e
 d <e i d e
 d IJn e i d IJd e i f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z e d j o9 e e i ƒ d j  o e i i e
 d ƒ n e ƒ  n d S(   sn   Hello World FUSE example in Python

   from http://osdir.com/ml/file-systems.fuse.devel/2006-06/msg00000.html
iÿÿÿÿN(   t   Fusei    i   t   scripts   /hellot   paths   Hello World!
t   strings   /mnt/fuse/hellot
   mountpoints   initialized %ss$   could not initialize script properlyt	   HelloStatc           B   s   e  Z d  „  Z RS(   c      
   C   s  d d d d d d d d d	 d
 g
 } d d d d
 d	 g } t  g  } | D] } | | d g qG ~ ƒ } t d oY t i t i d t d ƒ t i t d ƒ } x( | D] } t | | d ƒ | | <q¦ Wn t i t i d t | ƒ ƒ x" | D] } t |  | | | ƒ qî Wd  S(   Nt   st_modet   st_inot   st_devt   st_nlinkt   st_uidt   st_gidt   st_sizet   st_atimet   st_mtimet   st_ctimei    R   s   stat %ss   initial stat: %s(	   t   dictt   HELLOt   syslogt   LOG_INFOt   ost   statt   getattrt   reprt   setattr(   t   selft
   attributest   from_sourcet   _[1]t   attrt   initialt   source_statt	   attribute(    (    s   hellofuse.pyt   __init__   s    		-  (   t   __name__t
   __module__R!   (    (    (    s   hellofuse.pyR      s   t   HelloFSc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   sˆ   t  ƒ  } t d <| d j o t i d B| _ d | _ nJ | t d j o0 t i d B| _ d | _ t t d ƒ | _ n	 t	 i
 S| S(	   NR   t   /ií  i   R   i$  i   R   (   R   R   R   t   S_IFDIRR   R	   t   S_IFREGt   lenR   t   errnot   ENOENT(   R   R   t   st(    (    s   hellofuse.pyR   '   s    	c         c   s:   d d t  d d g } x | D] } t i | ƒ Vq Wd  S(   Nt   .s   ..R   i   (   R   t   fuset   Direntry(   R   R   t   offsett   rett   r(    (    s   hellofuse.pyt   readdir5   s     c         C   sA   | t  d j o t i Sn | d @t i j o t i Sn d S(   NR   i   i    (   R   R)   R*   R   t   O_RDONLYt   EACCES(   R   R   t   flags(    (    s   hellofuse.pyt   open<   s
    c         C   s|   | t  d j o t i Sn t t  d ƒ } | | j  o8 | | | j o | | } n t  d | | | !} n d } | S(   NR   R   t    (   R   R)   R*   R(   (   R   R   t   sizeR/   t   slent   buf(    (    s   hellofuse.pyt   readC   s    (   R"   R#   R   R2   R6   R;   (    (    (    s   hellofuse.pyR$   &   s   			c          C   s   d t  i }  t i d t i t i ƒ t i t i d ƒ t d d t i	 d |  d d ƒ } | i
 d	 | d
 d ƒ | i ƒ  d  S(   Ns   
Userspace hello example


t	   hellofuses   starting FUSE "hello world"t   versions   %prog t   usaget	   dash_s_dot	   setsinglet   valuest   errexi   (   R    t   fusageR   t   openlogt   LOG_PIDt   LOG_KERNR   R$   R-   t   __version__t   parset   main(   R>   t   server(    (    s   hellofuse.pyRI   O   s    	t   __main__(   i    i   (   t   __doc__R   t   sysR   R)   R   R-   R    t   fuse_python_apit   NoneR   R(   t   argvR   t   existst   abspatht   stderrt   StatR   R$   RI   R"   t   append(    (    (    s   hellofuse.pys   <module>   s(   <				8)	