I have a web site where I have been using persistently included Perl scripts
fairly heavily for about 20 years. Apparently, I have never worked in a
directory with spaces in its name, because i never realized until yesterday
that when BBEdit passes the including file path string as the first argument to
the script, it backslash-escapes it.
That is, I have <!— #bbinclude “whats_new.pl” … --> in file index.html in
directory /Users/neil/sites/zba html5/. The first argument to the Perl script
is the string "/Users/neil/Sites/zba\ html5/index.html” — note the backslash.
I’m sure there’s a good reason for this, but it makes the script programming
awkward. My script reads a file that it knows is in the same directory as the
HTML file by stripping the “index.html” from the tail of the first first
argument string, replacing it with "whats_new.txt”, and opening the resulting
path string. Of course, the path string is wrong — it shouldn’t have a
backslash in it.
I guess I can just remove any backslashes from the includer path argument, but
that feels like a real hack. Has anyone else dealt with this issue? Have any
solution or suggestions?
Thanks,
Neil Faiman
p.s. My working fix is “if it hurts, don’t do it” — i.e., change the directory
name to not have a space in it. But it bothers me knowing that my code is not
as robust as I thought.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.