(inp, out)
binhex(infilename, outfilename): create binhex-encoded copy of a file
binhex(infilename, outfilename): create binhex-encoded copy of a file
binhex ( infilename outfilename ) : create binhex - encoded copy of a file
def binhex(inp, out):
    """binhex(infilename, outfilename): create binhex-encoded copy of a file"""
    finfo = getfileinfo(inp)
    ofp = BinHex(finfo, out)

    with io.open(inp, 'rb') as ifp:
        # XXXX Do textfile translation on non-mac systems
        while True:
            d = ifp.read(128000)
            if not d: break
            ofp.write(d)
        ofp.close_data()

    ifp = openrsrc(inp, 'rb')
    while True:
        d = ifp.read(128000)
        if not d: break
        ofp.write_rsrc(d)
    ofp.close()
    ifp.close()
def binhex ( inp , out ) : finfo = getfileinfo ( inp ) ofp = BinHex ( finfo , out ) with io . open ( inp , 'rb' ) as ifp : # XXXX Do textfile translation on non-mac systems while True : d = ifp . read ( 128000 ) if not d : break ofp . write ( d ) ofp . close_data ( ) ifp = openrsrc ( inp , 'rb' ) while True : d = ifp . read ( 128000 ) if not d : break ofp . write_rsrc ( d ) ofp . close ( ) ifp . close ( )