Пример #1
0
def ejectCdrom(device):
    fd = os.open(device, os.O_RDONLY | os.O_NONBLOCK)

    # this is a best effort
    try:
        _isys.ejectcdrom(fd)
    except SystemError, e:
        log.warning("error ejecting cdrom (%s): %s" % (device, e))
        pass
Пример #2
0
def ejectCdrom(device, makeDevice = 1):
    if makeDevice:
        makeDevInode(device, "/tmp/cdrom")
        fd = os.open("/tmp/cdrom", os.O_RDONLY|os.O_NONBLOCK)
    else:
        fd = os.open(device, os.O_RDONLY|os.O_NONBLOCK)

    # this is a best effort
    try:
	_isys.ejectcdrom(fd)
    except SystemError, e:
        log.warning("error ejecting cdrom (%s): %s" %(device, e))
	pass
Пример #3
0
def ejectCdrom(device, makeDevice = 1):
    if makeDevice:
        makeDevInode(device, "/tmp/cdrom")
        fd = os.open("/tmp/cdrom", os.O_RDONLY|os.O_NONBLOCK)
    else:
        fd = os.open(device, os.O_RDONLY|os.O_NONBLOCK)

    # this is a best effort
    try:
	_isys.ejectcdrom(fd)
    except SystemError, e:
        log.warning("error ejecting cdrom (%s): %s" %(device, e))
	pass