I am currently using Acme (the Plan9ports version) on my Raspberry Pi 4B using 
Raspberry Pi OS. It works very well and I enjoy using it, but recently I have 
encountered a problem that I can't seem to solve.

I need to work with PNG image files that have been created and named by other 
people. When I create a file, I am very conservative about which characters I 
use in the filename (alphanumeric, underscore, and sometimes hyphen). These PNG 
image files, however, frequently contain parentheses, pound signs, and single 
quotes (apostrophes), like these:

Mary's first attempt (edited) #confirmed.png
John's second attempt (original) #unconfirmed.png

I have been able to create a plumbing rule that handles all of the characters 
in the filenames above, except for the single quotes (apostrophes). Whenever I 
try to include an escaped single quote in the "data matches" string, the 
plumber gives me this error when I use the "cat $HOME/lib/plumbing | 9p write 
plumb/rules" command to refresh:

9p: write error: runaway quoted string literal

This is the plumbing rule that is giving me the problem:

 # image files go to eom
type is text
data matches '[a-zA-Z¡-�0-9_\-./@ \(\)\']+'
data matches '([a-zA-Z¡-�0-9_\-./@ 
\(\)\']+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG|webp|WEBP)'
arg isfile      $0
plumb to image
plumb start eom $file

I don't know much about the plumber, so I am probably doing a lot of things 
wrong, but I would be very grateful for any help that anyone could provide. 
Thank you.

And by the way -- I know that in a filename with spaces, you need to swipe the 
entire filename first before you right click in order to have the click "take".

Thanks again.

--
Foss

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T3cd2a871851787df-Mad2171908e7e8ccd61b0abf4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to