Jump to content

File information: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Lemzwerg moved page File Information to File information without leaving a redirect: Only the first letter of a title should be uppercase
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Display ly file information in markup, including file name, file size, LilyPond version, date processed, time processed, time last modified, and the LilyPond command line.
Display ly file information in markup, including file name, file size, LilyPond version, date processed, time processed, time last modified, and the LilyPond command line.


<lilypond version="2.24.0">
<lilypond version="2.24">
#(define comml    (command-line))
#(define comml    (command-line))
#(define filen    input-file-name)
#(define filen    input-file-name)
Line 26: Line 26:
[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Really cool]]
[[Category:Really cool]]
[[Category:Snippet]]

Latest revision as of 05:31, 24 November 2025

Display ly file information in markup, including file name, file size, LilyPond version, date processed, time processed, time last modified, and the LilyPond command line.

\version "2.24"

#(define comml    (command-line))
#(define filen    input-file-name)
#(define siz      (object->string (stat:size (stat filen))))
#(define ver      (lilypond-version))
#(define dat      (strftime "%m/%d/%Y" (localtime (current-time))))
#(define tim      (strftime "%H:%M:%S" (localtime (current-time))))
#(define modt     (stat:mtime (stat filen)))
#(define modts    (strftime "%m/%d/%Y %H:%M:%S" (localtime modt)))

\markup \column {
  \line { "File Name = "        \filen }
  \line { "File Size = "        \siz   }
  \line { "LilyPond Version = " \ver   }
  \line { "Date Processed = "   \dat   }
  \line { "Time Processed = "   \tim   }
  \line { "Last Modified = "    \modts }
  \line { "Command Line = "     \comml }
}