REACT:Backup DATA Track

From Hydrogenaudio Knowledgebase
Revision as of 02:04, 17 February 2008 by Akkurat (talk | contribs) (Added category code)

Here's a method to backup all the files from an enhanced cd when ripping albums with REACT.


Brief explanation what the following code does:

  1. Check from a cuefile if there's a data track present in the CD.
  2. Get CD label from DIR command.
  3. Create a subdir DATA TRACK (<CD label>).
  4. Copy all files (+hidden and system files) with attributes from the CD drive including empty subdirs.
  5. Pause and print error message if there was an error in the copy process.


Edit your REACT.ini file and make sure that the following two lines are set correctly.

Under [Settings]:

CreateAllCuesheets=1

Under [UserSettings]:

CDDrive=E:

Change the drive letter to match your cd ripping drive.


Use the following code in your REACT-image.cfg or REACT-track.cfg file.

REM ** Copy all files from the CD if there's a data track.
SET /A DataExists=0

IF EXIST "@albumfile@.[mg].cue" (
    SETLOCAL ENABLEDELAYEDEXPANSION
    FOR /F "tokens=* delims=" %%i IN ('FINDSTR /R "TRACK....MODE*" "@albumfile@.[mg].cue"') DO SET /A DataExists=!DataExists! + 1
    SETLOCAL DISABLEDELAYEDEXPANSION
)

IF NOT %DataExists%==0 (
    ECHO ===== BACKING UP DATA FILES =====
    
    SETLOCAL ENABLEDELAYEDEXPANSION
    
    REM ** Get CD label
    FOR /F "tokens=5* delims= " %%a IN ('DIR @CDDrive@ ^| FIND /I "Volume in drive"') DO SET CDLabel=%%b
    
    SET DataDir=DATA TRACK ^(!CDLabel!^)
    MKDIR "!DataDir!"
    
    REM ** Copy all files (+hidden and system files) with attributes from the CD drive including empty subdirs
    XCOPY @CDDrive@\*.* "!DataDir!" /E /H /K
    
    REM ** Pause on errors.
    IF ERRORLEVEL 1 ECHO. &ECHO ===== COPY FAILED ===== &ECHO. &PAUSE
    
    SETLOCAL DISABLEDELAYEDEXPANSION
)


In example, you could put the above code between PUSHD and POPD lines in the post-processing section of the REACT-track.cfg file:

IF @Flac@==1 (
    PUSHD %TrackDir_Flac%
        IF %add_rg%==1 @tools@\Glob.exe -v -c @tools@\metaflac.exe %RG_MetaFlac% *.flac
        REM COPY /Y "@eaclog@" "EAClog.txt"

        <INSERT THE CODE HERE>

    POPD
)


This method has been tested to work at least in Windows XP.