Strange behaviour of system("start ...") [1.6.8,W2k] 
Author Message
 Strange behaviour of system("start ...") [1.6.8,W2k]

Hello,
I found this strange behaviour of system(), which is really annoying:

system ("start dir") fails, unless a file start.cmd (all executable
extensions possible?) exists in the current directory (path?).
Win2k, Ruby 1.6.8

This is what is described in the the book ("Pickaxe" I guess), where is
a forwarder in the description of the arguments "arguments are handled
the same manner as exec does". (I retranslate from german text.)
In exec-parameter description is written "executes an external command".

But, the content of the file doesn't matter, really executed is the
start-command. So the file should not be needed, or the file should be
executed instead of the command.

I can't imagine current behaviour is wanted.
Sorry I've now not enough time to dig into the 1.6.8-code to find the
exact reason for this behaviour.

Regards,
Michael B.



Sat, 06 Aug 2005 01:09:46 GMT  
 Strange behaviour of system("start ...") [1.6.8,W2k]

Quote:

> Hello,
> I found this strange behaviour of system(), which is really annoying:

> system ("start dir") fails, unless a file start.cmd (all executable
> extensions possible?) exists in the current directory (path?).

Or start.exe or start.bat presumably.

I don't understand what you think it should do instead? system("foo") runs
command "foo"



Sat, 06 Aug 2005 05:22:52 GMT  
 Strange behaviour of system("start ...") [1.6.8,W2k]
Quote:
> > Hello,
> > I found this strange behaviour of system(), which is really annoying:

> > system ("start dir") fails, unless a file start.cmd (all executable
> > extensions possible?) exists in the current directory (path?).

> Or start.exe or start.bat presumably.

> I don't understand what you think it should do instead? system("foo") runs
> command "foo"

start is an internal command.
Either the internal command should be executed and then the file shouldn't
be needed or
the file start.cmd (.exe,.bat,.rb,.py,.pl,...)should be executed.

Requiring the file and then executing the internal command is a little bit
strange.

-mb



Sat, 06 Aug 2005 05:51:10 GMT  
 Strange behaviour of system("start ...") [1.6.8,W2k]

Quote:

> > > system ("start dir") fails, unless a file start.cmd (all executable
> > > extensions possible?) exists in the current directory (path?).

> > Or start.exe or start.bat presumably.

> > I don't understand what you think it should do instead? system("foo") runs
> > command "foo"

> start is an internal command.

You mean internal to Windows' command line shell? Does
    system("cmd start dir")
do what you want?

That seems consistent with Unix. For example, if I try to use a command
which is actually a shell built-in command, it fails:

irb(main):001:0> system("ulimit -a")
=> false

I have to invoke the shell explicitly:

irb(main):003:0> system("bash -c \"ulimit -a\"")
core file size        (blocks, -c) unlimited
data seg size         (kbytes, -d) 524288
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1821
pipe size          (512 bytes, -p) 1
stack size            (kbytes, -s) 65536
cpu time             (seconds, -t) unlimited
max user processes            (-u) 910
virtual memory        (kbytes, -v) 589824
=> true

Quote:
> Requiring the file and then executing the internal command is a little bit
> strange.

That I agree with :-)

Regards,

Brian.



Sat, 06 Aug 2005 06:15:16 GMT  
 Strange behaviour of system("start ...") [1.6.8,W2k]
Hello brusch2,


Quote:
>> > I found this strange behaviour of system(), which is really annoying:

>> > system ("start dir") fails, unless a file start.cmd (all executable
>> > extensions possible?) exists in the current directory (path?).

>> Or start.exe or start.bat presumably.

>> I don't understand what you think it should do instead? system("foo") runs
>> command "foo"

bgn> start is an internal command.

on win nt/2k/xp. but on the 95 family, you can find start.exe in c:\windows\command directory
and command.com can't execute this command internally

--
Best regards,



Sat, 06 Aug 2005 20:21:19 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Strange behaviour of "rescue"

2. strange behaviour of "expect"

3. strange behaviour of "after"

4. Strange "Mail Delivery System" messages

5. "A" drive in W2K

6. IBM system 370 system call "DMXINV"

7. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

8. Forgetting "extended behaviour"

9. Puzzling behaviour on "IF ( )" stmt

10. Behaviour of "string trimright"

11. Behaviour of "after"?

12. behaviour of "tk_getOpenFile"

 

 
Powered by phpBB® Forum Software