Skip to content

Commit

Permalink
Force removal of temporary WAV files. Fixes #2
Browse files Browse the repository at this point in the history
It turned out that flac.exe propagates the readonly attribute
to the output file. Fortunately, FileSystemObject.DeleteFile()
has an optinal argument 'force' that overrides that attribute.

Version changed to 0.92.
  • Loading branch information
dmitryleskov committed Jun 15, 2013
1 parent f12c02b commit 335bc9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions AddFLACs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// AddFLACs.js - add FLAC audio files to iTunes media library
//
// Version: 0.91
// Version: 0.92
//
// Refer to the file COPYING.MIT for licensing conditions.
//
Expand Down Expand Up @@ -271,8 +271,10 @@ function Traverse(folder) {
if (fso.FileExists(tempTrackPath))
fso.DeleteFile(tempTrackPath)
}
// #2: it turned out that flac.exe preserves the readonly attribute,
// so it is necessary to force removal
log("Deleting temporary WAV file")
fso.DeleteFile(tempWAVPath)
fso.DeleteFile(tempWAVPath, true)
}
}
var subfolders = new Enumerator(folder.SubFolders)
Expand Down
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ call src\utf8to16\build.bat
"C:\Program Files (x86)\Pandoc\bin\pandoc.exe" -s --html5 -o dist\README.html README.md
for %%i in (AddFLACs.bat AddFLACs.js COPYING.MIT COPYING.GPL bin\flac.exe bin\metaflac.exe) do copy %%i dist
cd dist
if exist ..\AddFLACs-0.91.zip del ..\AddFLACs-0.91.zip
zip ..\AddFLACs-0.91.zip *
if exist ..\AddFLACs-0.92.zip del ..\AddFLACs-0.92.zip
zip ..\AddFLACs-0.92.zip *

0 comments on commit 335bc9e

Please sign in to comment.