Newbie: Simple Filesystem Writes

Hi

I’m trying to use NeroCOM to copy files from my hard drive to a DVD+RW, with no success :confused: . The (VB.Net) code is below:


  Private Finished As Boolean = True

  Public Sub TestBurn()
    ' source files
    Dim source As String = "C:\Archive\activity"
    Dim files As String() = System.IO.Directory.GetFiles(source)
    ' DVD filesystem stuff
    Dim dvdFS As New NEROLib.NeroFileSystemDescContainerClass
    Dim flags As NERO_BURN_FLAGS
    With dvdFS
      .BurnOptions = NEROLib.NERO_BURN_OPTIONS.NERO_BURN_OPTION_USE_JOLIET Or _
                     NEROLib.NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_ISO_FS
      .Name2 = "Test DVD"
    End With
    ' create the container
    Dim rootCont As NEROLib.NeroDirectoryContainer = dvdFS.RootDirectoryContainer
    ' add a directory
    rootCont.AddDirectory("activity", -1)
    ' add all the files
    For Each FullName As String In files
      Dim file As String = System.IO.Path.GetFileName(FullName)
      rootCont.SubDirectory("activity").AddFile2(file, FullName, -1, -1)
    Next
    ' burn stuff
    Finished = False
    flags = NERO_BURN_FLAGS.NERO_BURN_FLAG_BUF_UNDERRUN_PROT Or _
            NERO_BURN_FLAGS.NERO_BURN_FLAG_CLOSE_SESSION Or _
            NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_EJECT Or _
            NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE
    drive.BurnFileSystemContent(dvdFS, flags, 4, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P_RW)
    ' wait!
    While Not Finished
      System.Windows.Forms.Application.DoEvents()
    End While
    ' done
  End Sub

  Private Sub drive_OnAddLogLine(ByRef TextType As NERO_TEXT_TYPE, ByRef Text As String) Handles drive.OnAddLogLine
    Debug.WriteLine("Log: " & Text)
  End Sub

  Private Sub drive_OnDoneBurn(ByRef StatusCode As NERO_BURN_ERROR) Handles drive.OnDoneBurn
    Debug.WriteLine("Finished: " & [Enum].GetName(GetType(NERO_BURN_ERROR), StatusCode))
    Finished = True
  End Sub

  Private Sub drive_OnMajorPhase(ByRef phase As NERO_MAJOR_PHASE) Handles drive.OnMajorPhase
    Debug.WriteLine("Major phase: " & [Enum].GetName(GetType(NERO_MAJOR_PHASE), phase))
  End Sub

The output is:

Log: Write error
Finished: NERO_BURN_FAILED

Any help would be really appreciated!

Thanks

Camberwick.

An update: it seems the problem arises only when I’m trying to extend a VMS DVD (the write is successful if the DVD is empty). How can I enable multiple sequential writes using NeroCOM, so that the new data appears in addition to existing data?

I’m trying to implement a file backup utility, where the (DVD+RW) volume is used on a daily basis to hold incremental data, in addition to retaining previous days’ materials.

Many thanks

Camberwick