Hi,
I am strugling with the External process
API.
I want to open and continue some document from a
path with spaces.
Something like:
ExternalProcess
fork: 'start' arguments: (Array with: '"c:\My Test\AppDevGuide.pdf"'). or:
ExternalProcess
fork: 'cmd' arguments: (Array with: '/x' with: '/c' with: 'start' with: 'c:\My Test\AppDevGuide.pdf'). But these don't work.
I can do something like:
ExternalProcess shOne: 'c:\My
Test\StakePoint_1.36_Setup.exe'.
Which works and takes care of the spaces in the
path file but it still waits till the process is
finished which is not allways what I want. Often I want a do and continue
behaviour.
Does anyone has some exmples related to the use of
External process.
Regards,
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
How can I set the "real name" of the person sending an email using the
SimpleSMTPClient and an instance of MailMessage? For example, if my email address is [hidden email] but I want it to say it's from Carl Gundel, how does that code look? Thanks, -Carl Gundel http://www.runbasic.com http://www.libertybasic.com _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Carl Gundel wrote: > How can I set the "real name" of the person sending an email using the > SimpleSMTPClient and an instance of MailMessage? For example, if my email > address is [hidden email] but I want it to say it's from Carl Gundel, how > does that code look? 'Carl Grundel <[hidden email]>' ? Best regards Janko -- Janko Mivšek AIDA/Web Smalltalk Web Application Server http://www.aidaweb.si _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert-2
The first example won't work:
you can't use "start" as a command, because it doesn't exist as a .exe or .com
file. Also, when calling start with a filename in double quotes, you must supply
a window title: the syntax of the start command is:
START ["title"] [/Dpath] [/I] [/MIN] [/MAX]
[/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/WAIT] [/B] [command/program] [parameters] ...so if the first argument starts with
double quotes, it is interpreted as a window title. You want something
like:
start "" "c:\My
Test\AppDevGuide.pdf"
That will work from the command line, but
for a process you must supply a valid executable file, as you try in the second
example. You need a command line like this:
cmd /x /c start "" "C:\My
Test\AppDevGuide.pdf"
With the odd quoting code in
WinProcess>>startProcess:arguments:, the only way to get the above
commandLine is this:
ExternalProcess
fork: 'cmd' arguments: #('/x /c start "" "C:\My Test\AppDevGuide.pdf"') Essentially, we have bypassed the odd code,
which tries to add double-quotes to everything in the arguments collection. The
odd code is clearly wrong, since it fails to quote the first argument (e.g. /x
in your example). It would be fun to know what the programmer was
thinking when writing it, and the accompanying comment:
"Windows may parse things incorrectly if
the arguments contain spaces, so wrap them all in double quotes. Amazingly, this
seems to be ok even if people had already put double quotes in them."
If you want VW to wait until the start'ed
process finishes, insert /wait after the "".
Steve
From: [hidden email] on
behalf of Maarten MOSTERT
Sent: Sat 9/27/2008 16:00 To: VWNC Subject: [vwnc] External process examples Hi,
I am strugling with the External process
API.
I want to open and continue some document from a
path with spaces.
Something like:
ExternalProcess
fork: 'start' arguments: (Array with: '"c:\My Test\AppDevGuide.pdf"'). or:
ExternalProcess
fork: 'cmd' arguments: (Array with: '/x' with: '/c' with: 'start' with: 'c:\My Test\AppDevGuide.pdf'). But these don't work.
I can do something like:
ExternalProcess shOne: 'c:\My
Test\StakePoint_1.36_Setup.exe'.
Which works and takes care of the spaces in the
path file but it still waits till the process is
finished which is not allways what I want. Often I want a do and continue
behaviour.
Does anyone has some exmples related to the use of
External process.
Regards, _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Carl Gundel
Thanks Deanna. SimpleSMTPClient may be obsolete, but I am still using VW
7.4.1. Hopefully soon we'll be able to move to 7.6. -Carl Gundel Easy Windows programming - http://www.libertybasic.com Easy web programming - http://www.runbasic.com ----- Original Message ----- From: "Simpson, Deanna" <[hidden email]> To: "Carl Gundel" <[hidden email]> Sent: Saturday, September 27, 2008 9:32 PM Subject: RE: [vwnc] Net.MailMessage and "real names" SimpleSMTPclient uses an instance of NetUser to set the username. Try setting the NetUser instance's fullName. Also, keep in mind that SimpleSMTPClient is considered to be obsolete, and you may want to start using SMTPClient. Good luck, Deanna Simpson -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Carl Gundel Sent: Saturday, September 27, 2008 7:29 PM To: VWNC Subject: [vwnc] Net.MailMessage and "real names" How can I set the "real name" of the person sending an email using the SimpleSMTPClient and an instance of MailMessage? For example, if my address is [hidden email] but I want it to say it's from Carl Gundel, how does that code look? Thanks, -Carl Gundel http://www.runbasic.com http://www.libertybasic.com _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert-2
Hi Steve, > Message du 28/09/08 12:07 |
In reply to this post by Steven Kelly
At 05:29 AM 9/28/2008, Steven Kelly wrote:
Essentially, we have bypassed the odd code, which tries to add double-quotes to everything in the arguments collection. The odd code is clearly wrong, since it fails to quote the first argument (e.g. /x in your example). It would be fun to know what the programmer was thinking when writing it, and the accompanying comment: Well, that would be me. I suspect what I was thinking was something along the lines of "ok, this seems to work for the cases I have". We'd already noticed the excessive quoting of the command-line options - that's in AR 54659, which primarily deals with using the right encoding when shelling out under Windows. I certainly didn't know about the case of "start" treating its arguments differently if they're quoted or not. It seems to me that in this case the start can just be omitted anyway, as it's implicit in providing a data file name with an association. At least for me ExternalProcess fork: 'cmd' arguments: (Array with: '/x' with: '/c' with: 'c:\My Test\AppDevGuide.pdf'). works. --
Alan Knight [|], Engineering Manager, Cincom Smalltalk
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert-2
Surely you didn’t expect Windows to be consistent, Alan?
:-). In any case, thanks for adding the honest comment: if there’s code
that’s likely to break, I’d much rather see a comment like “Amazingly,
this seems to be ok” than no comment. FWIW, cmd /x /c will work for non-executable files if and only
if command extensions are enabled (the default). For the full details, see “help
cmd” and “help start” for the Windows versions you are
interested in. Just cmd /x /c does not work for URLs – for those you must
use START – so it seems easier to use START all the time. Steve From: Alan Knight
[mailto:[hidden email]] At 05:29 AM 9/28/2008, Steven Kelly wrote: Essentially, we have bypassed
the odd code, which tries to add double-quotes to everything in the arguments
collection. The odd code is clearly wrong, since it fails to quote the first
argument (e.g. /x in your example). It would be fun to know what the programmer
was thinking when writing it, and the accompanying comment:
-- Alan Knight [|], Engineering Manager, Cincom Smalltalk _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |