Skip to content

Bug in which LabRecorder does not record data if the file name ends with a space #93

@jiversen

Description

@jiversen

Hello,

I discovered, painfully, that if the file name string entered in the File Name/Template field of LabRecorder has one or more spaces at the end some weird things happen that can lead to data loss (either data not being recorded or an existing file being overwritten without first making a backup of it as it usually does).

Windows 10
LabRecorder 1.16.3
Unity Marker and position outlet streams only (LSL4Unity)
BIDS unchecked

Here's what I've seen when having a space after the file name--it happened because I pasted my favorite file name template and (now realize) it inadvertently included a space (and maybe a return) in the copied text.

• LabRecorder appears to silently fail to record any LSL data (the file size counter remains at 0 kB even though the clock counts up) and though the console says 'started data collection', 'wrote footer', and 'closing the file' like normal, in some cases it does not save any file.

• Sometimes it does save a file, despite the file size counter staying at 0 kB, and the file does appear to have some data in it. I haven't figured out why sometimes it does vs. does not save a file.

• However, if a file of that name (without the trailing spaces) exists already, LabRecorder does not back it up as usual before recording over it and thus you lose the original file.

Anyway, it's easy enough to work around, and seems like it should be a trivial fix to strip trailing spaces, but given the seriousness of the consequences it's probably worth checking the logic to see how it could fail the test for existing files.

Thanks,

John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions