asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
445 stars 109 forks source link

Colon in filename gives an error when creating a PNG from a Lilypond diagram on a Windows folder #424

Closed georgeraraujo closed 1 year ago

georgeraraujo commented 1 year ago

Hi, I run asciidoctor in a Linux guest VM in VirtualBox on a Windows host. I mount a Windows folder on a mount point in the Linux VM.

I noticed that the last release supports Lilypond diagrams (THANKS!) and decided to try it. When I processed the sample document, I got an error; when I tried it again in a folder inside the VM's virtual hard disk, it worked fine:

vboxuser@asciidoctor:/mnt/windows_shared_folder$ asciidoctor -r asciidoctor-diagram lilypond.adoc
asciidoctor: ERROR: lilypond.adoc: line 6: Failed to generate image: Protocol error @ rb_sysopen - /mnt/windows_shared_folder/diag-:md5:b7d074b335dbb39dbd4e4501c5a27831.png
vboxuser@asciidoctor:/mnt/windows_shared_folder$ cd ~/linux_folder/
vboxuser@asciidoctor:~/linux_folder$ asciidoctor -r asciidoctor-diagram lilypond.adoc
vboxuser@asciidoctor:~/linux_folder$ ls
diag-:md5:b7d074b335dbb39dbd4e4501c5a27831.png  lilypond.adoc  lilypond.html
vboxuser@asciidoctor:~/linux_folder$

I think that's because the filename for the generated PNG has a colon (:). Would you consider changing the colon for some other character, or dropping it altogether?

Thanks!

pepijnve commented 1 year ago

Since the file is being written to the Windows host filesystem the filename needs to be valid for NTFS. That would explain the error. I'll change the separator character to something that's valid on Windows filesystems as well.