From: fosskapper@gmail.com
To: 9fans <9fans@9fans.net>
Subject: [9fans] Can you plumb a file with a single quote in the filename?
Date: Sun, 26 Jan 2025 16:19:39 -0500 [thread overview]
Message-ID: <17379263790.3bad57.3959@composer.9fans.topicbox.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 2976 bytes --]
next reply other threads:[~2025-01-26 22:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 21:19 fosskapper [this message]
2025-01-26 23:10 ` Steve Simon
2025-01-27 0:24 ` fosskapper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17379263790.3bad57.3959@composer.9fans.topicbox.com \
--to=fosskapper@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).