Welcome! Log In Create A New Profile

Advanced

Timestamps in filenames

Posted by RN8JR 
Timestamps in filenames
September 26, 2020 10:59AM
I am trying to get accurate timestamps in the filenames generated by monkeylogic. It seems like the timestamp (HHMMSS) added to the filename format in the main menu is only updated when monkeylogic is started and not when the run button is pressed. This means that a) filenames do not reflect the actual start date/time of the session and b) if two sessions are run consecutively within the same instance of monkeylogic, they will have identical filenames. Is there any way to alter the naming scheme so that the date/timestamp added to the filename is determined by the time you press the 'run' button? This would also help avoid accidentally pressing "yes" when monkeylogic asks if you want to overwrite the existing file, since that only happens when the filenames are identical.
Re: Timestamps in filenames
September 28, 2020 08:57PM
You are right about the timestamp added to the filename. The time should be determined when the run button is clicked. To make it so, add one line of code to Line 816 (or somewhere around it) of monkeylogic.m like the following.
Line 816:    if ~datafilename_manually_typed, MLPath.DataFile = MLConfig.FormattedName; end
Line 817:    datafile = [MLPath.ExperimentDirectory MLPath.DataFile MLConfig.Filetype];
Line 818:    if 2==exist(datafile,'file')

By the way, you can restore deleted files from the Recycle Bin, if you accidentally overwrite them.
Re: Timestamps in filenames
October 01, 2020 11:55AM
Thanks Jaewon, this fixed the issue.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.