def daemonize():
    if platform.system() == 'Windows':
        raise Exception('Daemonizing is currently not supported on Windows.')
       
    if os.fork() == 0: 
        os.setsid()
        if os.fork():
            os._exit(0)
    else:
        os._exit(0)
                
    os.umask(0)
    maxfd = get_maxfd()

    # Iterate through and close all file descriptors.
    for fd in range(0, maxfd):
        try:
            os.close(fd)
        except OSError:	# ERROR, fd wasn't open to begin with (ignored)
            pass

    os.open(REDIRECT_TO, os.O_RDWR)
    os.dup2(0, 1)
    os.dup2(0, 2)
Parse a file and return to intermediary syntax.
dataset/ETHPy150Open pascalw/Airplayer/airplayer/utils.py/daemonize--crossover with--dataset/ETHPy150Open Alexis-benoist/eralchemy/eralchemy/parser.py/markdown_file_to_intermediary