Logo Search packages:      
Sourcecode: k9copy version File versions  Download package

bool K3bDevice::Device::open ( bool  write = false  )  const

Open the device for acces via a file descriptor.

Returns:
true on success or if the device is already open.
See also:
close()

Definition at line 1545 of file k3bdevice.cpp.

References close(), and devicename().

Referenced by discSize(), diskInfo(), getDataMode(), getIndex(), indexScan(), init(), isEmpty(), readCdText(), readRawToc(), and readToc().

{
  if( d->openedReadWrite != write )
    close();

  d->openedReadWrite = write;

#ifdef Q_OS_FREEBSD
  if( !d->cam ) {
    d->cam = cam_open_pass (m_passDevice.latin1(), O_RDWR,0 /* NULL */);
    kdDebug() << "(K3bDevice::openDevice) open device " << m_passDevice
            << ((d->cam)?" succeeded.":" failed.") << endl;
  }
  return (d->cam != 0);
#endif
#ifdef Q_OS_LINUX
  if( d->deviceFd == -1 )
    d->deviceFd = openDevice( QFile::encodeName(devicename()), write );

  return ( d->deviceFd != -1 );
#endif
}


Generated by  Doxygen 1.6.0   Back to index