Fwd: Unusual file duplication

10 views
Skip to first unread message

W R Gibson

unread,
Dec 22, 2025, 6:05:58 AM12/22/25
to OpenSongApp


---------- Forwarded message ---------
From: W R Gibson <williamrob...@gmail.com>
Date: Mon, 22 Dec 2025 at 10:59
Subject: Unusual file duplication
To: Gareth Evans <garethev...@gmail.com>


Hello, and season's greetings.
I started getting this issue a couple of months ago.
When I edit a song using the OpenSong internal editing function, then save the edit, a duplicate file of zero information other than the title is created in the Songs folder.
Nect time I use OpenSong and use the Full Index function, that empty file is added to the Song Menu.
My work around is to check the Songs Folder and manually delete any zero files.
This doesn't occur 100% but just enough to be annoying, please help.
Regards
William Gibson

Virus-free.www.avg.com
Song Folder.jpg
Song Menu in OpenSong.jpg

Gareth Evans

unread,
Dec 23, 2025, 5:28:59 AM12/23/25
to OpenSongApp
Hi William,

This can happen if another bit of code is accessing the same file (either OpenSongApp, external synchronisation application, Android file manager, etc.).  This means the expected file is locked, so the app then creates a copy/new version (with an appended (1), (2), etc.).  Most file access in the app is asynchronous (a background thread) so that it runs in the background without freezing the UI, but it can mean it is possible to try and call a new write function when the system has been significantly delayed, or a file has been locked during that process.

I'll add a bit of code to automatically check for zero length/corrupted files like this and move them to the OpenSong/Import folder (rather than just deleting them as a safety precaution).
You'll see a line like the following in the OpenSong/Settings/fileWriteActivity.txt log file if it has dealt with zero byte files:

(Songs) [Subdirectory]/[Filename] is zero bytes/corrupt. Move to Import folder for now

This will happen on boot and will run before any song index is built.  This fix will be in the next release.

Best wishes,
Gareth
Reply all
Reply to author
Forward
0 new messages