From 58df1656afc2ca59a81d848a7bec845ce7b674a0 Mon Sep 17 00:00:00 2001 From: basisbit Date: Sat, 12 Sep 2015 00:48:54 +0000 Subject: * log if the audio file which is specified in the song .txt does not exist or is not accessible * more aggressively try to write changes to text files on windows (also write if file is already opened somewhere). This allows modifying song .txt files on windows 7/8/10 even when VirtualStore is active for the user. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3135 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UPath.pas | 4 ++-- src/base/USong.pas | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/base/UPath.pas b/src/base/UPath.pas index ba5daf59..77ccd65d 100644 --- a/src/base/UPath.pas +++ b/src/base/UPath.pas @@ -1028,7 +1028,7 @@ function TPathImpl.IsFile(): boolean; begin // note the different specifications of FileExists() on Win32 <> Unix {$IFDEF MSWINDOWS} - Result := FileSystem.FileExists(Self); + Result:= FileSystem.FileExists(Self); {$ELSE} Result := Exists() and not IsDirectory(); {$ENDIF} @@ -1183,7 +1183,7 @@ var SaveMode: word; begin // save changes in write mode (= not read-only mode) - if ((fMode and 3) <> fmOpenRead) then + if ((fMode) <> fmOpenRead) then begin if (fMode = fmCreate) then SaveMode := fmCreate diff --git a/src/base/USong.pas b/src/base/USong.pas index bff39a29..041f3853 100644 --- a/src/base/USong.pas +++ b/src/base/USong.pas @@ -989,6 +989,10 @@ begin //Add Mp3 Flag to Done Done := Done or 4; + end + else + begin + Log.LogError('Can''t find audio file in song: ' + DecodeStringUTF8(FullFileName, Encoding)); end; end -- cgit v1.2.3