Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
ó ¾Ã9Qc@s»dZdddddgZddlZddlZddlZddlZddlZdZd „Zgd „Z d „Z e e d „Z e e d „Z ee d„Ze e d„ZdS(s=This module contains helper functions for dealing with files.t issamefiletlinkfiletcopyfiletlinkorcopyfiletoverwrite_safelyiÿÿÿÿNicCs1tj|ƒ}tj|ƒ}tjj||ƒS(N(toststattpathtsamestat(tpath1tpath2ts1ts2((s3/usr/lib/python2.7/site-packages/slip/util/files.pyt _issamefile#scCs?|tkrt}nyt||ƒSWn|k r:tSXdS(sECheck whether two paths point to the same file (i.e. are hardlinked).N(tTruet ExceptionR tFalse(R R tcatch_stat_exceptions((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR*s    cCsôt||dtƒrdStjj|ƒ}tjj|ƒ}tjj|ƒ}t}xtt j ƒD]n}t j d|tj d|ƒ}ytj ||ƒWn+tk rË}|jtjkrÅqÓ‚qeXt}PqeW|rðtj||ƒndS(sUHardlink srcpath to dstpath. Attempt to atomically replace dstpath if it exists.RNtprefixtdir(RtOSErrorRRtabspathtdirnametbasenameRtxrangettempfiletTMP_MAXtmktemptextseptlinkterrnotEEXISTRtrename(tsrcpathtdstpathtdstdnametdstbnamet hardlinkedtattemptt_dsttmpte((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR6s$c Cs¨t||dtƒrdStjj|ƒ}tjj|ƒ}tjj|ƒ}t|dƒ}tj d|tjj d|dt ƒ}t }|rÏyt j ||jƒt}WqÏt jtfk rËqÏXn|sët j ||jƒnd} xa| dkrT|jtƒ} y|j| ƒWqô|jƒ|jƒtj|jƒ‚qôXqôW|jƒ|jƒtj|j|ƒ|r¤tjƒdkr¤tj|ƒndS( s�Copy srcpath to dstpath. Abort operation if e.g. not enough space is available. Attempt to atomically replace dstpath if it exists.RNtrbRRtdeleteti(RRRRRRRtopenRtNamedTemporaryFileRRtshutiltcopymodetnameRtErrortNonetreadt BLOCKSIZEtwritetclosetunlinkR tselinuxtis_selinux_enabledt restorecon( R!R"tcopy_mode_from_dsttrun_restoreconR#R$tsrcfilet dsttmpfilet mode_copiedtdata((s3/usr/lib/python2.7/site-packages/slip/util/files.pyRWs@      cCsiyt||ƒdSWn:tk rQ}|jtjtjtjfkrR‚qRnXt||||ƒdS(stFirst attempt to hardlink srcpath to dstpath, if hardlinking isn't possible, attempt copying srcpath to dstpath.N(RRRtEMLINKtEPERMtEXDEVR(R!R"R;R<R(((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR�s !c Cstjj|ƒ}tjj|ƒ}t}d}|rQtjƒdkrQt}nly8tj|ƒ\}}|dkrˆt d|ƒ‚nWn1t k r¼} | j t j kr¶t }q½‚nX|sìtj||ƒ|rütj|ƒqünd} x‚ttjƒD]q} tjd|tjd|ƒ} ytj|| ƒWn.t k rk} | j t jkreqn‚qX| } PqW| dkr˜tt jdƒ‚n|r¸| r¸tj| |ƒnytj| |ƒWntj| ƒ‚nX|rütj|ƒndS(spCreate a symlink, optionally replacing dstpath atomically, optionally setting or preserving SELinux context.isgetfilecon(%r) failedRRs/No suitable temporary symlink could be created.N(RRRRRR2R8R9t lgetfilecont RuntimeErrorRRtENOENTRtsymlinkR:RRRRRRtIOErrort lsetfileconR tremove( R!R"tforcetpreserve_contextR#R$R<tctxtretR(tdsttmpR&R'((s3/usr/lib/python2.7/site-packages/slip/util/files.pytsymlink_atomically£sR        c Csätjj|ƒ}tjj|ƒ}tjj|ƒ}d}d}d}tjj|ƒ} |r{tjƒdkr{t }nzt j d|tjj d|ƒ\}}| rÅ|rÅt j||ƒn| r|rtj|ƒ\} } | dkrtd|ƒ‚qntj|dƒ}d}|j|ƒ|jƒd}tj||ƒ|r|| rltj|| ƒq|tj|ƒnWd|r“|jƒn|r©tj|ƒn|rßtjj|ƒrßytj|ƒWqßqßXnXdS(s¶Safely overwrite a file by creating a temporary file in the same directory, writing it, moving it over the original file, eventually preserving file mode and SELinux context.iRRsgetfilecon(%r) failedtwN(RRtrealpathRRR2texistsR8R9RRtmkstempRR.R/t getfileconREtfdopenR5R6R t setfileconR:tisfileR7( Rtcontentt preserve_modeRLtdir_tbasetfdtfttmpnameRSRNRM((s3/usr/lib/python2.7/site-packages/slip/util/files.pyRÞsJ       (t__doc__t__all__RR8R.RRR4R RRRRRRRPR(((s3/usr/lib/python2.7/site-packages/slip/util/files.pyts          !6 ;