newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: newdep on January 10, 2008, 11:52:10 AM

Title: process on windows
Post by: newdep on January 10, 2008, 11:52:10 AM
on Xp ->



This (process "c:/windows/system32/cmd.exe ") does create a directory called .exe in the current directory?? why is that? ;-)





Norman.
Title:
Post by: Lutz on January 10, 2008, 01:31:09 PM
I have no idea what Windows is doing here, but could verify, that the spawnvp() system call is called with the correct parameters. I suppose that ".exe' is some kind of file semaphore.



This does not impact normal usage of 'process', e.g. doing a (process "c:/WINDOWS/system32/notepad.exe")



Lutz
Title:
Post by: m35 on January 10, 2008, 07:12:47 PM
#!newlisp
(setq _P_WAIT 0)
(setq _P_NOWAIT 1)
(setq _P_OVERLAY 2)

(import "crtdll.dll" "_spawnvp")

;(setq cmd "cmd.exe") ; starts cmd.exe
;(setq cmd "c:/WINDOWS/system32/notepad.exe") ; starts notepad
;(setq cmd "c:\windows\system32\cmd.exe") ; starts cmd.exe
(setq cmd "c:/windows/system32/cmd.exe") ; makes .exe folder

(setq nullarg 0)
(setq pnullarg (address nullarg))

(println (_spawnvp _P_NOWAIT cmd pnullarg))


How very odd...



Edit:


C:>c:/windows/system32/cmd.exe

C:>c:/windows/system32/cmd.exe
A subdirectory or file .exe already exists.


Well at least it's consistent.
Title:
Post by: newdep on January 11, 2008, 07:52:46 AM
Actualy... why does (process "newlisp") not popup ?

Its started but i dont see it anywhere..





Even stranger:



This works ->

(process "c:windowssystem32notepad.exe")



But this doesnt ->

(process "c:program filesnewlispnewlisp.exe")





does the <space> has something to do with this?
Title:
Post by: Lutz on January 11, 2008, 10:03:32 AM
newlisp.exe is a shell application, which doesn't have its own window like notepad.exe. The shell works with std in/out/error of the application running in it.



Lutz
Title:
Post by: m35 on January 11, 2008, 10:19:53 AM
Like Lutz said, it seems that if you start a command-line program from a command-line program, it uses the same console window.



e.g. cmd starting cmdC:>cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:>
e.g. newlisp starting newlisp> (process "newlisp.exe")
1956
> newLISP v.9.2.0 on Win32, execute 'newlisp -h' for more info.

>


This behavior is consistent with my Ubuntu terminal.
> (process "newlisp")
5320
> newLISP v.9.1.0 on Linux, execute 'newlisp -h' for more info.

>


At least on windows, if you want to open a command-line program in its own console window, try this.(process "cmd.exe /c start cmd.exe")