Discussion:
BLAT won't send attachments with commas in their filenames
(too old to reply)
Rich Pasco
2008-02-21 19:13:00 UTC
Permalink
I'm using BLAT 2.6.2 under Windows XP.

Today I had trouble attaching a binary file, and after some testing
found out that the trouble was due to a comma in its filename.

This works:

blat ... -attach "temp.pdf"

but this doesn't

blat ... -attach "te,p.pdf"

where both files "temp.pdf" and "te,p.pdf" exist and have identical
contents, and the "..." designate otherwise identical options.

- Rich
Rich Pasco
2008-02-21 19:25:18 UTC
Permalink
I got the same results with BLAT 2.6.3 from
http://home.att.net/~chip.programmer/blat/v2.63/blat.exe

By the way, with either version there is no error message or warning of
any kind. The e-mail is sent with just the body text and no attachment.

- Rich

Rich Pasco wrote:

> I'm using BLAT 2.6.2 under Windows XP.
>
> Today I had trouble attaching a binary file, and after some testing
> found out that the trouble was due to a comma in its filename.
>
> This works:
>
> blat ... -attach "temp.pdf"
>
> but this doesn't
>
> blat ... -attach "te,p.pdf"
>
> where both files "temp.pdf" and "te,p.pdf" exist and have identical
> contents, and the "..." designate otherwise identical options.
>
> - Rich
>
>
>
>
>
Tim Musson
2008-02-22 01:21:27 UTC
Permalink
Hey Rich,

On Thursday, February 21, 2008 at 2:25:18 PM you wrote

RP> I got the same results with BLAT 2.6.3 from
RP> http://home.att.net/~chip.programmer/blat/v2.63/blat.exe

RP> By the way, with either version there is no error message or warning of
RP> any kind. The e-mail is sent with just the body text and no attachment.

>> I'm using BLAT 2.6.2 under Windows XP.
>>
>> Today I had trouble attaching a binary file, and after some testing
>> found out that the trouble was due to a comma in its filename.
>>
>> This works:
>>
>> blat ... -attach "temp.pdf"
>>
>> but this doesn't
>>
>> blat ... -attach "te,p.pdf"
>>
>> where both files "temp.pdf" and "te,p.pdf" exist and have identical
>> contents, and the "..." designate otherwise identical options.

That is because the comma is what Blat uses to attach multiple
files... file1.pdf,file2.pdf,etc.pdf

Do you really need to use comma's in a filename?

--
Tim Musson
Flying with The Bat! eMail v3.99.29
Don't take life too seriously; No one gets out alive.
Blat Manager, current version is 2.6.2, see www.blat.net
Kevin van Houten
2008-02-21 21:00:23 UTC
Permalink
--- Also sprach Rich Pasco..

> I'm using BLAT 2.6.2 under Windows XP.
>
> Today I had trouble attaching a binary file, and after some testing
> found out that the trouble was due to a comma in its filename.
>
> This works:
>
> blat ... -attach "temp.pdf"
>
> but this doesn't
>
> blat ... -attach "te,p.pdf"
>
> where both files "temp.pdf" and "te,p.pdf" exist and have identical
> contents, and the "..." designate otherwise identical options.

I wonder if it would have worked if you had two files
named "te" and "p.pdf".. :)


--
Qe'van the Unclothed, Bard of Nor
jIqonmo' jIyIn.
"I live because I write."

.... 'Thank you, Pinky - that was bordering on coherence.'


ICQ: 4958826
MSN: ***@hotmail.com
AIM: Qevan
Skype: kevinvanhouten
Yahoo: Qevan
Google: kevin.vanhouten klingonbard
MySpace: ***@yahoo.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12 GIT/L/MU d s++:+ a+ C++$
U++++$ P++$ L++ E-- W++ N++ o-- K- w$
O- M V PS+ PE Y+ PGP t+ 5+@ X R tv+
b++ DI+ D G e++ h---- r+++ y++++>*
------END GEEK CODE BLOCK------
namtog
2008-02-21 21:35:45 UTC
Permalink
Greetings,

Rich Pasco wrote;
"I'm using BLAT 2.6.2 under Windows XP.

Today I had trouble attaching a binary file, and after some testing
found out that the trouble was due to a comma in its filename.

This works:

blat ... -attach "temp.pdf"

but this doesn't

blat ... -attach "te,p.pdf"

where both files "temp.pdf" and "te,p.pdf" exist and have identical
contents, and the "..." designate otherwise identical options.""

>From syntax.txt included with the Blat download;
"-attach <file>: attach binary file(s) to message (filenames comma
separated)"

If you use a comma in a file name Blat
will see it as another file. Since these
new files don't exist the mail is sent without them.

Rename your files as Kevin suggested.

Namtog
Rich Pasco
2008-02-22 07:08:18 UTC
Permalink
namtog wrote:

> If you use a comma in a file name Blat
> will see it as another file.

That is incorrect behavior, if the filename is surrounded by quotes,
because commas are allowed characters in Windows XP filenames.

So you have acknowledged the bug I am reporting. Will it be fixed?

- Rich
Tim Musson
2008-02-22 12:25:24 UTC
Permalink
Hey Rich,

On Friday, February 22, 2008 at 2:08:18 AM you wrote

>> If you use a comma in a file name Blat
>> will see it as another file.

RP> That is incorrect behavior, if the filename is surrounded by quotes,
RP> because commas are allowed characters in Windows XP filenames.

RP> So you have acknowledged the bug I am reporting. Will it be fixed?

I don't agree that it is a bug. Spaces are also an acceptable
character in Windows filenames. The Quotes around it make sure Blat
sees it as a filename (because normally the Blat command line is space
delimited...

All the other Blat options that allow multiples use commas to delimit,
so I don't want to change how the -attach* options work.

I seem to recall \ being used as an escape char for an addressing
option. Try it with -attach "te\,p.pdf"...

--
Tim Musson
Flying with The Bat! eMail v3.99.29
MS Windows -- From the people who brought you EDLIN!
Blat Manager, current version is 2.6.2, see www.blat.net
namtog
2008-02-22 13:26:55 UTC
Permalink
Greetings,

Rich Pascal wrote;
"because commas are allowed characters in
Windows XP filenames."

The source for Blat is available here;

http://sourceforge.net/project/showfiles.php?group_id=81910

It is possible to build a custom version of Blat.

Blat currently has the option of setting the character
for a comment;

-comment <char> : use this character to mark the
start of comments in options
files and recipient list files.
The default is ;

Something similar should work for the comma delimiter.

After perusing your web site I can safely state
that you are a clever guy. So you will probably,
if that is the option you choose, want to roll up
your own version of Blat. If you are looking for
a outside developer to build a custom version of
Blat you are at the right place.

In either case please rename your version of Blat
to avoid confusion.

This is the first time I have heard of someone
having trouble with the comma delimiter. May I
ask what system generates files with them in
their name?

Could you simply have your manager change it's
output.

Namtog
Rich Pasco
2008-02-22 15:20:57 UTC
Permalink
Somehow, I'm feeling less than satisfied by your answer, namtog.

When I report that a published application program fails to follow
established standards for the OS environment in which it operates,
I am told to fix it myself (in a custom version) rather than thanked
for bringing the bug to the attention of the developers.

The "system" that generates file names with commas in them is
irrelevant, they are allowed as part of filenames in Windows, and it
should not have to be changed. But since you asked, in this case those
systems include Microsoft Word and Adobe Acrobat. Good luck in
convincing MS and Adobe to modify their applications to disallow commas
in filenames just because Blat can't handle them!

The bottom line is that, in Windows XP (as in an all versions since
Windows 95) commas and spaces are legitimate characters in file names
and that command-line applications should be able to handle filenames
containing them provided that they are enclosed in quotes.

- Rich


namtog wrote:

> After perusing your web site I can safely state
> that you are a clever guy. So you will probably,
> if that is the option you choose, want to roll up
> your own version of Blat. If you are looking for
> a outside developer to build a custom version of
> Blat you are at the right place.
>
> In either case please rename your version of Blat
> to avoid confusion.
>
> This is the first time I have heard of someone
> having trouble with the comma delimiter. May I
> ask what system generates files with them in
> their name?
>
> Could you simply have your manager change it's
> output.
>
> Namtog
>
>
>
>
namtog
2008-02-22 16:18:13 UTC
Permalink
Greetings,

Rich spoke;
"Somehow, I'm feeling less than satisfied by your
answer, namtog."

Most subscribers to the YGB are used to that feeling.

Then Rich mentioned;
"established standards for the OS environment"

Blat is most likely used on MS Windows. But it is
not the only OS. Blat also runs natively on ReactOS;

http://www.reactos.org/en/index.html

Blat will also run on *nix under Wine;

http://www.winehq.org/

You have many other options. Like;

SendEmail;

http://caspian.dotconf.net/menu/Software/SendEmail/

or febooti;

http://www.febooti.com/products/command-line-email/

or Bmail;

http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

or NetMailBot;

http://www.exclamationsoft.com/exclamationsoft/NetMailBot/

or Fake sendmail;

http://glob.com.au/sendmail/

Or IndigoMail;

http://www.indigostar.com/sendmail.htm

The list goes on and on.

We now heard from Rich;
"thanked for bringing the bug to the attention"

Thanks.

In the last paragraph Rich wrote;
"The bottom line is that. . ."

The bottom line is that Blat is freeware. You are
not, in any way, owed anything. If Blat works for
you great. If the Blat development team wants
to make a change or add a feature that is completely
up to them.

Feel free to fix this "bug" yourself. If you like
you can submit the change for consideration by
the Blat team. If it is incorporated into a new
release you will be credited.

Bye and bye when I mentioned your web site I was
referring to ;

http://www.richpasco.org/

Not;

http://www.pasco.org/

Thanks for the input,
Namtog
Rick
2008-02-22 16:37:07 UTC
Permalink
At this point, I think your only remaining options are dire
imprecations and threats of a multi-million dollar lawsuit, since
there was not an immediate mobilization to fix this problem.

Actually, though, considering that Blat is on the order of fifteen
years old, it's somewhat amazing to me that you've actually found a
bug that has existed all this time without anyone else finding it first.

Unfortunately, though, since there is only one programmer who is
currently doing anything useful with the source code that we're aware
of, the deck is stacked against you unless you can pique his interest
into working on the problem.

Since you're the first one ever affected by this, it's not looking
very good, I'm afraid. That's why namtog pointed out that the source
code is available. You could do something positive (as contrasted to
the path the thread is currently taking) by developing a patch to
rectify it. I can't imagine anyone would be against incorporating it
into the next build.

All in all, though, I think if you happened to discover that a
Microsoft or an Adobe product that failed to properly handle a quoted
filename containing a comma and reported it, you would probably get
even less response than you have here, with even less possibility of
finding a cure, despite having paid huge sums of money for the software.

The bottom line: You're profiting from a free software package, and
complaining when an extremely obscure bug doesn't elicit any
response. It's not apathy, it's disinterest.

Rick


>Somehow, I'm feeling less than satisfied by your answer, namtog.
>
>When I report that a published application program fails to follow
>established standards for the OS environment in which it operates,
>I am told to fix it myself (in a custom version) rather than thanked
>for bringing the bug to the attention of the developers.
>
>The "system" that generates file names with commas in them is
>irrelevant, they are allowed as part of filenames in Windows, and it
>should not have to be changed. But since you asked, in this case those
>systems include Microsoft Word and Adobe Acrobat. Good luck in
>convincing MS and Adobe to modify their applications to disallow commas
>in filenames just because Blat can't handle them!
>
>The bottom line is that, in Windows XP (as in an all versions since
>Windows 95) commas and spaces are legitimate characters in file names
>and that command-line applications should be able to handle filenames
>containing them provided that they are enclosed in quotes.
>
> - Rich
namtog
2008-02-22 17:07:07 UTC
Permalink
Greetings,

Blat isn't the only client that won't allow
a comma in a file name. I've sent myself the
file bard.txt many times, it's my test file.

When I renamed it b,ard.txt Yahoo email would
not send it. See screen capture here;

http://tech.ph.groups.yahoo.com/group/blat/photos/view/398a?b=3

Wearing my detective hat,
Namtog
Chip
2008-02-23 02:22:37 UTC
Permalink
> At this point, I think your only remaining options are dire
> imprecations and threats of a multi-million dollar lawsuit, since
> there was not an immediate mobilization to fix this problem.
>
> Actually, though, considering that Blat is on the order of fifteen
> years old, it's somewhat amazing to me that you've actually found a
> bug that has existed all this time without anyone else finding it first.
>
> Unfortunately, though, since there is only one programmer who is
> currently doing anything useful with the source code that we're aware
> of, the deck is stacked against you unless you can pique his interest
> into working on the problem.
>
> Since you're the first one ever affected by this, it's not looking
> very good, I'm afraid. That's why namtog pointed out that the source
> code is available. You could do something positive (as contrasted to
> the path the thread is currently taking) by developing a patch to
> rectify it. I can't imagine anyone would be against incorporating it
> into the next build.
>
> All in all, though, I think if you happened to discover that a
> Microsoft or an Adobe product that failed to properly handle a quoted
> filename containing a comma and reported it, you would probably get
> even less response than you have here, with even less possibility of
> finding a cure, despite having paid huge sums of money for the software.
>
> The bottom line: You're profiting from a free software package, and
> complaining when an extremely obscure bug doesn't elicit any
> response. It's not apathy, it's disinterest.
>
> Rick


Consider it piqued. :)

However, the work involved will not be easy as the _primary_ purpose of the
comma for Blat is to separate multiple items. A simple work around in the
short term would to be replace the comma with an asterisk in the command
line.

--
Chip
Rich Pasco
2008-02-27 21:29:53 UTC
Permalink
I am not the first to report problems with commas in filenames.
The problem was reported to this list by Owen Watson on 5 Jan 2006.
As with my bug report, it was met with arguments telling him he was
wrong, and suggestions of work-arounds, but never fixed.

Rick wrote:

> it's somewhat amazing to me that you've actually found a
> bug that has existed all this time without anyone else finding it first.
> ...
> Since you're the first one ever affected by this,

namtog wrote:

> This is the first time I have heard of someone
> having trouble with the comma delimiter. May I
> ask what system generates files with them in
> their name?
Rich Pasco
2008-02-22 07:33:21 UTC
Permalink
--- In ***@yahoogroups.com, Tim Musson <***@...> wrote:

> That is because the comma is what Blat uses to attach multiple
> files... file1.pdf,file2.pdf,etc.pdf

Tim, although a comma can separate filenames if used outside
of quotes, it should be an allowed character in a filename if
used inside quotation marks. For example:

This should attach multiple files (notice the quotes)

blat ... -attach "first file.pdf","second file.pdf"

This should attach a single file (again, notice the quotes)

blat ... -attach "red, white, and blue.pdf"

> Do you really need to use comma's in a filename?

Yes. My manager (client) needed me to send out a file to his
list of subscribers "without making any changes whatsoever"
and I infer that would mean without changing its name.

- Rich
Jason C. Lamb
2008-02-22 16:08:47 UTC
Permalink
v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}..shape {behavior:url(#default#VML);}
Ok&#8230; I&#8217;ll chime in&#8230;



Rich, I completely agree with you thatthis is not how BLAT should handle commas in file names. My argumentwould be that many people are using BLAT in a scripted environment, so it wouldnot be unreasonable to expect varied (unchecked) input. Something like thiscould be common usage:

>FOR %i IN (attachments\*.txt) DO Blat body.txt&#8211;to ***@myorg.com &#8211;attach&#8220;%i&#8221;



Since Blat doesn&#8217;t handle the commacorrectly (agreeing with you Rich) I have to make the above line much morecomplicated to check for a comma in each file name, and rename if necessary.



On the other hand, Blat is freeware, Manypeople have put many hours of work into the product, and were gracious enoughto offer up there efforts to the public. Free of charge.

They are under no obligation to changetheir software even if it has a bug/feature that you don&#8217;t like. Ifyou can&#8217;t work around this issue until the developers see a need tochange the code then look for another applications that has requirementswritten that you can hold the developer to. Or&#8230; do as namtogsuggests and brush up on your C++.



Jason



---------------------------------


From:***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of Rich Pasco
Sent: Friday, February 22, 200810:21 AM
To: ***@yahoogroups.com
Subject: Re: [blat] Re: BLAT won'tsend attachments with commas in their filenames




Somehow, I'm feeling less than satisfied by youranswer, namtog.

When I report that a published application program fails to follow
established standards for the OS environment in which it operates,
I am told to fix it myself (in a custom version) rather than thanked
for bringing the bug to the attention of the developers.

The "system" that generates file names with commas in them is
irrelevant, they are allowed as part of filenames in Windows, and it
should not have to be changed. But since you asked, in this case those
systems include Microsoft Word and Adobe Acrobat. Good luck in
convincing MS and Adobe to modify their applications to disallow commas
in filenames just because Blat can't handle them!

The bottom line is that, in Windows XP (as in an all versions since
Windows 95) commas and spaces are legitimate characters in file names
and that command-line applications should be able to handle filenames
containing them provided that they are enclosed in quotes.

- Rich

namtog wrote:

> After perusing your web site I can safely state
> that you are a clever guy. So you will probably,
> if that is the option you choose, want to roll up
> your own version of Blat. If you are looking for
> a outside developer to build a custom version of
> Blat you are at the right place.
>
> In either case please rename your version of Blat
> to avoid confusion.
>
> This is the first time I have heard of someone
> having trouble with the comma delimiter. May I
> ask what system generates files with them in
> their name?
>
> Could you simply have your manager change it's
> output.
>
> Namtog
>
>
>
>






---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]
Rich Pasco
2008-02-23 08:01:26 UTC
Permalink
Hi Jason,

Thank you for your support. I'm glad that we're in agreement that BLAT
"should" properly handle all filenames that are legitimate to the
operating system environment.

Nothing in my bug report was meant in any way to diminish the hard work
that the developers put into bringing Blat to its present state, nor to
demand that anyone do any work on my schedule. I understand and
appreciate that all development on Blat is a labor of love by volunteers
who have no obligation to do anything for me.

I was offering a gift to the developers by pointing out how Blat falls
short of what a reasonable user might expect (in the absence of a
written requirements spec, one would it to follow the OS convention of
accepting any legitimate filename, surrounded by quotes if it contains
spaces or commas).

I really don't know about the Blat developers, but if I someone reported
a bug in some software I had developed, even if freeware, I would thank
them for letting me know, and put fixing it onto my queue for future
improvements.

- Rich

Jason C. Lamb wrote:

> Rich, I completely agree with you that this is not how BLAT
> should handle commas in file names....
> [snip]
> Since Blat doesn't handle the comma correctly (agreeing with
> you Rich) I have to make the above line much more complicated
> to check for a comma in each file name, and rename if necessary.
>
> On the other hand, Blat is freeware, Many people have put many
> hours of work into the product, and were gracious enoughto offer
> up there efforts to the public. Free of charge.
>
> They are under no obligation to change their software even if it
> has a bug/feature that you don't like. If you can't work around
> this issue until the developers see a need to change the code then
> look for another applications that has requirements written that
> you can hold the developer to. Or, do as namtog suggests and
> brush up on your C++.
>
> Jason
namtog
2008-02-23 15:11:58 UTC
Permalink
Greetings,

Chip wrote;
"Consider it piqued. :)
<snip>
A simple work around in the short term would to be
replace the comma with an asterisk in the command
line."

Chip you may not have noticed in this ever growing
thread but Rich has the unique problem of not being
allowed to change the file name in any way. If memory
serves this is the first occurrence of this issue.

Rich wrote;
"Nothing in my bug report
<snip>
no obligation to do anything for me.

Sir I have never doubted your intentions or method
for champing your POV. This newsgroup has been
slow of late and you have been a articulate breath
or fresh air.

At this point we (the YGB) seem to have consensus
that MS uses quotation marks as a escape mechanism.

Your main argument seems to be that since MS software
accepts CF that the Blat -attach option should follow
suite.

I'm still not convinced the CF (Comma in Filename)
issue is a bug.

A common way to alter Blat to recognize quotation marks
to escape the comma would be to use a little bit of
regex. This raises performance issues. Perhaps not
for every user of Blat but it would certainly affect
those who use attachments.

Blat has many users. Should the good of the one out way
the good of the many?

At this point I will remind myself of the Blat Philosophy;

http://www.blat.net/?philosophy.html

"Blat should be;

Fast"

This is why I suggested a alternative. Treating the
comma delimiter much like the default comment ;.
I suspect this would have a number of advantages.

1. It would be easier to implement.
2. Most would not be affected, since they already live
with the default.
3. The mentioned performance issues.

If it is decided that any change is justified.

If it was a simple matter of reading one file name
with a comma in it I would agree with your suggested
change. That multiple file are involved changes the
situation dramatically.

Namtog
Phillip Lynch
2008-02-23 22:16:29 UTC
Permalink
I haven't seen all this thread, so it may have already been mentioned...

Why not just use the 8.3 name to reference the files?


<---->
A simple work around in the short term would to be
replace the comma with an asterisk in the command
line."

Chip you may not have noticed in this ever growing
thread but Rich has the unique problem of not being
allowed to change the file name in any way. If memory
serves this is the first occurrence of this issue.


[Non-text portions of this message have been removed]
Chip
2008-02-24 02:34:04 UTC
Permalink
The problem with using the existing backlash \ character to escape a comma,
is that the backslash character is a legitimate path delimiter for Winders
(not so for *nix).

The use of commas to separate filenames from each other has been in use for
a long time. At the moment, there is not much I can do to the Blat source
that will give you the comma as a legit filename character for Winders
without seriously breaking Blat.

As I suggested in another message, use an asterisk in your command line in
place of the comma.

You have a real bug for your instance, but other uses for the comma in this
case trumps your issue. I could add another character to escape the comma
with, but then we're in the position all over again -- how to escape that
escape character for someone else's filename peculiarities.

--
Chip



----- Original Message -----
From: "Rich Pasco" <***@pasco.org>
To: <***@yahoogroups.com>
Sent: Saturday, February 23, 2008 3:01 AM
Subject: Re: [blat] Re: BLAT won't send attachments with commas in their
filenames


> Hi Jason,
>
> Thank you for your support. I'm glad that we're in agreement that BLAT
> "should" properly handle all filenames that are legitimate to the
> operating system environment.
>
> Nothing in my bug report was meant in any way to diminish the hard work
> that the developers put into bringing Blat to its present state, nor to
> demand that anyone do any work on my schedule. I understand and
> appreciate that all development on Blat is a labor of love by volunteers
> who have no obligation to do anything for me.
>
> I was offering a gift to the developers by pointing out how Blat falls
> short of what a reasonable user might expect (in the absence of a
> written requirements spec, one would it to follow the OS convention of
> accepting any legitimate filename, surrounded by quotes if it contains
> spaces or commas).
>
> I really don't know about the Blat developers, but if I someone reported
> a bug in some software I had developed, even if freeware, I would thank
> them for letting me know, and put fixing it onto my queue for future
> improvements.
>
> - Rich
namtog
2008-02-24 16:48:02 UTC
Permalink
Greetings,

Chip wrote;

"You have a real bug for your instance, but other
uses for the comma in this case trumps your issue."

No doubt about it Rich has what I would call a issue
that for him renders Blat useless.

Chip mentioned;
"As I suggested in another message, use an asterisk
in your command line in place of the comma."

This confuses me. The comma in Rich's example is
in varying locations. Would you mind posting a
generic example of a command line that would
handle that. A random comma in a file name.

Then Chip spoke;
"I could add another character to escape the comma
with, but then we're in the position all over again
-- how to escape that escape character for someone
else's filename peculiarities."

I have a idea that would help with this problem.
First posted in Message #10281.

"Blat currently has the option of setting the character
for a comment;

-comment <char> : use this character to mark the
start of comments in options
files and recipient list files.
The default is ;

Something similar should work for the comma delimiter."

I bored all reading this one additional time in
Message #10298

I would not expect Chip to add this feature to the
standard build of Blat. Not when it only affects one
user.

All is not lost. Let me revisit another suggestion. A
custom build of Blat specifically for Rich. Don't stop
reading just yet.

What if this custom build recognizes two commas instead
of one.

file,name.txt,,file1,name.txt

for the delimiter.

This is for Blat 2.6.2 The change will affect both
email address and attachment. Open up parsing.cpp.
Scroll down to line 88;

if ( srcptr[len] == ',' )

change it to;

if ( srcptr[len] == ',,' )

This might work if a double character is allowed.
I don't know enough MS C/C++ to say. I don't
have a box to compile Blat on. Not until the middle
of next week. Long story.

Chip what do you think. Anyone else.

Am I barking up the wrong tree?

One last item. If a custom version of Blat is built
please rename it to avoid confusion.

I'm confused enough as it be.

Namtog
Chip
2008-02-24 18:40:47 UTC
Permalink
<snip>
>
> Chip mentioned;
> "As I suggested in another message, use an asterisk
> in your command line in place of the comma."
>
> This confuses me. The comma in Rich's example is
> in varying locations. Would you mind posting a
> generic example of a command line that would
> handle that. A random comma in a file name.
>

blat -attach "te*p.pdf"

The recipient would receive the _original_ filename without modification,
per Rich's requirements. Problem solved.

One thing Rich fails to understand is that Blat is written in C and quoted
command line arguments are passed to main() without the quotes. I could
possibly go find the original command line passed to Blat, and reparse that
command line after the C preprocessor has already parsed it, but whatever I
do, solving Rich's problem means breaking the current users. See above for
a solution. Others have posted regex parsers to change characters from one
value to another. Solutions are available, if Rich is willing to accept
them.

The semicolon (;) is a legitimate filename character, for Winders. How many
times do I need to escape the semicolon before I can accept it for itself?
Conversely, how do I implement a new escape character for filenames without
disrupting all existing users?

--
Chip
Tim Musson
2008-02-25 13:21:12 UTC
Permalink
C> blat -attach "te*p.pdf"

C> The recipient would receive the _original_ filename without modification,
C> per Rich's requirements. Problem solved.

The other wildcard char that could be used is ?.

* gets as many positions as needed (te*p.pdf).
, is a one position wild card char (te?p.pdf).

I also like Phillip's suggestion, use the 8x3 filename. So the
filename te,p.pdf becomes te_p~1.pdf.

--
Tim Musson
Flying with The Bat! eMail v3.99.29
Keyboard not available - Press F1; to continue.
Blat Manager, current version is 2.6.2, see www.blat.net
namtog
2008-02-25 15:37:33 UTC
Permalink
Greetings,

This is a quick read.

What makes a valid Windows file name?

http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx

Who knew file names are so complicated.

Namtog
Rich Pasco
2008-02-27 21:20:26 UTC
Permalink
Chip wrote:

> blat -attach "te*p.pdf"
>
> The recipient would receive the _original_ filename without modification,
> per Rich's requirements. Problem solved.

Not quite.

Suppose the directory contained both "temp.txt" and "te,p.txt" and one
wanted to send only the latter file?

Why is it so hard to accept that the right fix is to modify the
command-line parser to work as it should: commas separate filenames
*except* within quoted strings, where they are interpreted as part
of the filename.

> One thing Rich fails to understand is that Blat is written in C and quoted
> command line arguments are passed to main() without the quotes.

I'm not failing to understand that. That is an excuse, not a fix.

My dad always used to say, "A poor workman always blames his tools."

> I could
> possibly go find the original command line passed to Blat

That might be necessary, since the argc and argv parameters don't
seem to be what is needed.

> but whatever I do, solving Rich's problem means breaking the current users

Of course, there are people for whom depending on a bug may lead to
failure, e.g.

- attach "file1.txt,file2.txt"

which should attach one file with a comma in its name, not two, whereas

- attach file1.txt,file2.txt

should attach two files, as should

- attach "file1.txt","file2.txt"

I don't know what to say about this argument, other than some
inconvenience is necessary along the road to doing the right thing.

- Rich
Chip
2008-02-28 02:13:08 UTC
Permalink
Rich,

If you truly understand what the C parser does, and also fully understand
that Blat uses the comma character to separate file names, then you will
know that your "bug" is more work to solve than any effort is worth.

What you want to be the right thing is really going to break the code, with
no solution in sight. To solve *one* man's problem, you want me to break
many others'. How is this fair to the majority? Your "bug" is really a
feature of Blat and not a design or implementation bug.

I won't say you are wrong, I am going to say that I and others have offered
solutions.

Now, instead of complaining further, try offering up a solution that fits
this criteria:

1. Must be acceptable to C command line parser and passed to main() in
argv[].

2. Must allow comma separated filenames.

3. Optionally, should allow comma within a filename.

If I change parser.cpp to allow a pipe character to be used as an escape for
filenames only, then how would Blat users be effected who might want to pipe
their output elsewhere, or use other programs and languages to spawn Blat?
Would having to escape the comma be counter to your stated requirement that
you must not change the filename?

I can't use a colon (:) to escape the comma, that is a legitimate drive
letter separater.

I can't use the less than or greater than signs (<>) because they can be
used for routing input and output.

Everything else I can type from my US keyboard is a legitimate character for
filename usage. There again, adding anything to escape a comma means you
need to change the filename syntax when you pass your command line to Blat.

To #2 above, what is the difference between -attach "op,tions.txt"
and -attach "op,tions.txt", where the former is a list of files while the
latter is a single file? Here is a command line I just used, with each
option on separate lines:

blat
-
-body "Testing argv"
-s "argv"
-t myself
-p attmail
-log blat.log
-superdebug
-attach "op,tions.txt",blat.log,"op,tions.txt"

The attach list is per your request. When I read argv[] in main(), I
printed the following list:

argv[ 0] = e:\blat264\release\blat
argv[ 1] = -
argv[ 2] = -body
argv[ 3] = Testing argv
argv[ 4] = -s
argv[ 5] = argv
argv[ 6] = -t
argv[ 7] = myself
argv[ 8] = -p
argv[ 9] = attmail
argv[10] = -log
argv[11] = blat.log
argv[12] = -superdebug
argv[13] = -attach
argv[14] = op,tions.txt,blat.log,op,tions.txt

Now, given your claim to understand what C does to parse the command line,
tell me with exacting detail how I should know which commas belong to a
specific filename and which are delimiters between filenames?

Don't go claim to understand C command line parser, and get huffy about your
supposed bug, unless you can offer real tangible solutions with real C
source code changes to parser.cpp. Remember, too, that the backslash is a
path delimiter.

--
Chip
Liz Ackerman
2008-02-28 17:40:12 UTC
Permalink
Oh this kind of conversation hurts my head, LOL.

I guess its simpler to just use the old DOS 8.3 for filenames and only allow
the "." as the extension delimiter??

To me its simply KISS, keep it simple. I am not a programmer, but I can
appreciate the work involved in making programs work the way that users
anticipate them to. Are we so isolated here in North America that we assume
the rest of the world follows the same naming file naming conventions? Using
the comma instead of the period seems European to me. If a program is
written to follow US English standards, why would we expect it to know some
European languages as well. I interviewed a few years ago to hire an inhouse
database programmer, and of the 5 candidates we interviewed, 3 were recent
immigrants to Canada, two of them from former communist regimes. I remember
one of them commenting...programming is the same all over the world cause
most of the programming languages use US English. Is this not true? So while
his SQL tools had Russian words on the menus, when he coded it was in
English.

Liz



Rich,

If you truly understand what the C parser does, and also fully understand
that Blat uses the comma character to separate file names, then you will
know that your "bug" is more work to solve than any effort is worth.

What you want to be the right thing is really going to break the code, with
no solution in sight. To solve *one* man's problem, you want me to break
many others'. How is this fair to the majority? Your "bug" is really a
feature of Blat and not a design or implementation bug.

I won't say you are wrong, I am going to say that I and others have offered
solutions.

Now, instead of complaining further, try offering up a solution that fits
this criteria:

1. Must be acceptable to C command line parser and passed to main() in
argv[].

2. Must allow comma separated filenames.

3. Optionally, should allow comma within a filename.

If I change parser.cpp to allow a pipe character to be used as an escape for

filenames only, then how would Blat users be effected who might want to pipe

their output elsewhere, or use other programs and languages to spawn Blat?
Would having to escape the comma be counter to your stated requirement that
you must not change the filename?

I can't use a colon (:) to escape the comma, that is a legitimate drive
letter separater.

I can't use the less than or greater than signs (<>) because they can be
used for routing input and output.

Everything else I can type from my US keyboard is a legitimate character for

filename usage. There again, adding anything to escape a comma means you
need to change the filename syntax when you pass your command line to Blat.

To #2 above, what is the difference between -attach "op,tions.txt"
and -attach "op,tions.txt", where the former is a list of files while the
latter is a single file? Here is a command line I just used, with each
option on separate lines:

blat
-
-body "Testing argv"
-s "argv"
-t myself
-p attmail
-log blat.log
-superdebug
-attach "op,tions.txt",blat.log,"op,tions.txt"

The attach list is per your request. When I read argv[] in main(), I
printed the following list:

argv[ 0] = e:\blat264\release\blat
argv[ 1] = -
argv[ 2] = -body
argv[ 3] = Testing argv
argv[ 4] = -s
argv[ 5] = argv
argv[ 6] = -t
argv[ 7] = myself
argv[ 8] = -p
argv[ 9] = attmail
argv[10] = -log
argv[11] = blat.log
argv[12] = -superdebug
argv[13] = -attach
argv[14] = op,tions.txt,blat.log,op,tions.txt

Now, given your claim to understand what C does to parse the command line,
tell me with exacting detail how I should know which commas belong to a
specific filename and which are delimiters between filenames?

Don't go claim to understand C command line parser, and get huffy about your

supposed bug, unless you can offer real tangible solutions with real C
source code changes to parser.cpp. Remember, too, that the backslash is a
path delimiter.

--
Chip

.

<http://geo.yahoo.com/serv?s=97359714/grpId=311137/grpspId=1705007389/msgId=
10323/stime=1204165056/nc1=4507179/nc2=3848640/nc3=4990216>



[Non-text portions of this message have been removed]
namtog
2008-02-28 18:25:49 UTC
Permalink
Greetings,

Liz wrote;
"programming is the same all over the world cause
most of the programming languages use US English."

Don't know much about international programming
standards. It is possible to write Perl in Latin
and other languages;

http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html

Sometimes Perl is "whitened." That is all characters
are replaced with white space. Try reading some of
that!


For more than you have ever wanted to know
about Perl;

http://en.wikipedia.org/wiki/Perl

Namtog
Liz Ackerman
2008-02-28 19:00:45 UTC
Permalink
See, I don't know much, do I? In my case, we were looking for someone who
could program in VB, and I mentioned that his being Russian might be a
problem? That was his comment.

I haven't had to worry about Latin since Grade 11! I dropped it in Grade 12
and took a typing class instead, LOL, figured I get more out of being good
on a keyboard than Latin. But you know Moms...they are always right, she
said there might be a day when I would need Latin. ha!

And whitened text...I only experience that when replying to some of those
Incredimail messages...I hate that.

Liz




Greetings,

Liz wrote;
"programming is the same all over the world cause
most of the programming languages use US English."

Don't know much about international programming
standards. It is possible to write Perl in Latin
and other languages;

http://www.csse.
<http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html>
monash.edu.au/~damian/papers/HTML/Perligata.html

Sometimes Perl is "whitened." That is all characters
are replaced with white space. Try reading some of
that!

For more than you have ever wanted to know
about Perl;

http://en.wikipedia <http://en.wikipedia.org/wiki/Perl> .org/wiki/Perl

Namtog

.

<http://geo.yahoo.com/serv?s=97359714/grpId=311137/grpspId=1705007389/msgId=
10331/stime=1204223151/nc1=4507179/nc2=5202322/nc3=5170412>



[Non-text portions of this message have been removed]
Kevin van Houten
2008-02-24 21:23:48 UTC
Permalink
--- Also sprach namtog..

> No doubt about it Rich has what I would call a issue
> that for him renders Blat useless.

For what it's worth...similar issues happen with just the
plain dos command line...things like 'del' barf when
working with commas in filenames...

C:\test>dir *.pdf
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 01:18 PM 3,120,778
te,other_chars_ending_in_p.pdf
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
3 File(s) 11,674,212 bytes
0 Dir(s) 105,476,542,464 bytes free

C:\test>del te,other_shares*.pdf
Could Not Find C:\test\te

C:\test>del te,other*
Could Not Find C:\test\te

C:\test>del te*other*

C:\test>dir
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 03:18 PM <DIR> .
02/24/2008 03:18 PM <DIR> ..
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
2 File(s) 8,553,434 bytes
2 Dir(s) 105,479,663,616 bytes free
--
Qe'van the Unclothed, Bard of Nor
jIqonmo' jIyIn.
"I live because I write."

.... 'You're silly.' --Scott
'No, actually I'm just mentally ill.' --Gen


ICQ: 4958826
MSN: ***@hotmail.com
AIM: Qevan
Skype: kevinvanhouten
Yahoo: Qevan
Google: kevin.vanhouten klingonbard
MySpace: ***@yahoo.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12 GIT/L/MU d s++:+ a+ C++$
U++++$ P++$ L++ E-- W++ N++ o-- K- w$
O- M V PS+ PE Y+ PGP t+ 5+@ X R tv+
b++ DI+ D G e++ h---- r+++ y++++>*
------END GEEK CODE BLOCK------
tahattmeruh
2008-02-26 08:54:36 UTC
Permalink
del “te,p.pdf”

will work. And this is how it is supposed to be



Marc



From: sentto-311137-10307-1203955811-tahattmeruh=***@returns.groups.yahoo.com [mailto:sentto-311137-10307-1203955811-tahattmeruh=***@returns.groups.yahoo.com] On Behalf Of Kevin van Houten
Sent: Sunday, February 24, 2008 10:24 PM
To: ***@yahoogroups.com
Subject: Re: [blat] Re: BLAT won't send attachments with commas in their filenames



--- Also sprach namtog..

> No doubt about it Rich has what I would call a issue
> that for him renders Blat useless.

For what it's worth...similar issues happen with just the
plain dos command line...things like 'del' barf when
working with commas in filenames...

C:\test>dir *.pdf
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 01:18 PM 3,120,778
te,other_chars_ending_in_p.pdf
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
3 File(s) 11,674,212 bytes
0 Dir(s) 105,476,542,464 bytes free

C:\test>del te,other_shares*.pdf
Could Not Find C:\test\te

C:\test>del te,other*
Could Not Find C:\test\te

C:\test>del te*other*

C:\test>dir
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 03:18 PM <DIR> .
02/24/2008 03:18 PM <DIR> ..
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
2 File(s) 8,553,434 bytes
2 Dir(s) 105,479,663,616 bytes free
--
Qe'van the Unclothed, Bard of Nor
jIqonmo' jIyIn.
"I live because I write."

.... 'You're silly.' --Scott
'No, actually I'm just mentally ill.' --Gen

ICQ: 4958826
MSN: ***@hotmail.com <mailto:kbard%40hotmail.com>
AIM: Qevan
Skype: kevinvanhouten
Yahoo: Qevan
Google: kevin.vanhouten klingonbard
MySpace: ***@yahoo.com <mailto:qevan%40yahoo.com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12 GIT/L/MU d s++:+ a+ C++$
U++++$ P++$ L++ E-- W++ N++ o-- K- w$
O- M V PS+ PE Y+ PGP t+ 5+@ X R tv+
b++ DI+ D G e++ h---- r+++ y++++>*
------END GEEK CODE BLOCK------





[Non-text portions of this message have been removed]
Rich Pasco
2008-02-27 21:22:08 UTC
Permalink
Well said, Marc.

tahattmeruh wrote:

> del “te,p.pdf”
>
> will work. And this is how it is supposed to be
Jason C. Lamb
2008-02-25 16:40:43 UTC
Permalink
v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}..shape {behavior:url(#default#VML);}st1\:*{behavior:url(#default#ieooui) }
But

>del&#8220;te,other_chars_ending_in_p.pdf&#8221;

and

>delth*.pdf



would work&#8230;.



As well as:

>del&#8220;te,other_chars_ending_in_p.pdf&#8221;, &#8220;te,p.pdf&#8221;

notice the comma used as a file delimiter&#8230;



---------------------------------


From:***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of Kevin van Houten
Sent: Sunday, February 24, 20084:24 PM
To: ***@yahoogroups.com
Subject: Re: [blat] Re: BLAT won'tsend attachments with commas in their filenames




--- Also sprach namtog..

> No doubt about it Rich has what I would call a issue
> that for him renders Blat useless.

For what it's worth...similar issues happen with just the
plain dos command line...things like 'del'barf when
working with commas in filenames...

C:\test>dir *.pdf
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 01:18 PM 3,120,778
te,other_chars_ending_in_p.pdf
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
3 File(s) 11,674,212 bytes
0 Dir(s) 105,476,542,464 bytes free

C:\test>del te,other_shares*.pdf
Could Not Find C:\test\te

C:\test>del te,other*
Could Not Find C:\test\te

C:\test>del te*other*

C:\test>dir
Volume in drive C has no label.
Volume Serial Number is 8017-F8A8

Directory of C:\test

02/24/2008 03:18 PM <DIR> .
02/24/2008 03:18 PM <DIR> ..
02/24/2008 01:18 PM 4,276,717 te,p.pdf
02/24/2008 01:21 PM 4,276,717 temp.pdf
2 File(s) 8,553,434 bytes
2 Dir(s) 105,479,663,616 bytes free
--
Qe'van the Unclothed, Bard of Nor
jIqonmo' jIyIn.
"I live because I write."

..... 'You're silly.' --Scott
'No, actually I'm just mentally ill.' --Gen

ICQ: 4958826
MSN: ***@hotmail.com
AIM: Qevan
Skype: kevinvanhouten
Yahoo: Qevan
Google: kevin.vanhouten klingonbard
MySpace: ***@yahoo.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12 GIT/L/MU d s++:+ a+ C++$
U++++$ P++$ L++ E-- W++ N++ o-- K- w$
O- M V PS+ PE Y+ PGP t+ 5+@ X R tv+
b++ DI+ D G e++ h---- r+++ y++++>*
------END GEEK CODE BLOCK------






---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

[Non-text portions of this message have been removed]
Chip
2008-02-28 02:28:21 UTC
Permalink
> I'm using BLAT 2.6.2 under Windows XP.
>
> Today I had trouble attaching a binary file, and after some testing
> found out that the trouble was due to a comma in its filename.
>
> This works:
>
> blat ... -attach "temp.pdf"
>
> but this doesn't
>
> blat ... -attach "te,p.pdf"
>
> where both files "temp.pdf" and "te,p.pdf" exist and have identical
> contents, and the "..." designate otherwise identical options.
>
> - Rich


Try this syntax:

blat ... -attach "\"te,p.pdf\""


You want commas in your filenames, there is your solution without any code
changes on my part. Tested and works.

--
Chip
namtog
2008-02-28 15:21:57 UTC
Permalink
Greetings,

Rich wrote;
"The problem was reported to this list by
Owen Watson on 5 Jan 2006."

Rich then quoted me;
"namtog wrote:

> This is the first time I have heard of someone
> having trouble with the comma delimiter."

You are correct. My memory failed me. I was looking
at the issue backwards. The problem is not with
the comma as file delimiter but rather the
correct escape sequence for file names with
commas in them

You also may have noticed that Chip solved the
issue with this example;

-attach "\"File1\",
\"File2 with spaces\",
\"File 3 with , a comma\""

Posted in message #8108.

So a solution to your particular problem would be
to use a little bit of regex to isolate the file
names with commas in them.

In Perl you could start to sniff them out with;

if($string =~ m/(,)
{print "Filename $string has a comma\n"}
# Now print file names with commas to a new file
# to make sure we have the files we want
# Notice the >> to append file
open(FN, ">>file_name.tmp");
print FN "$string\n";
close FN;

# Now we add escape sequence
$escape_filename = "\"$string\""";
{print "Filename rewritten to $escape_filename"\n};

# print to a file escaped file name(s)
open(ESC_FN, ">>escape_filename.txt");
print ESC_FN "$escape_filename\n";
close ESC_FN;

The above is a rough example.

While your at it you may also wish to provide
provisions for file names with spaces in them.

\"File2 with spaces\"

Although the comma escape sequence would appear
to work for both scenarios.



Namtog
Rich Pasco
2008-02-28 22:32:16 UTC
Permalink
Chip wrote:

> Try this syntax:
>
> blat ... -attach "\"te,p.pdf\""
>
>
> You want commas in your filenames, there is your solution without any code
> changes on my part. Tested and works.

Thank you, Chip. That's not quite as clean as allowing
the command-line syntax that I requested, but it sure beats
to do it.writing a new command-line parser.

Part of our problem is that we never had a design spec for what we
wanted. Another part of our problem is that C and Windows came from
two different places. A command-line parser which always strips
quotation marks off its arguments is not helpful when we expect

BLAT ... -attach "a,b.txt"

to refer to one file, but

BLAT ... -attach a,b.txt

to refer to two.

- Rich
Continue reading on narkive:
Loading...