>>>>> "Pedro" == Pedro Pinto <quixote72@hotmail.com> writes:
Pedro> Hi there,
Pedro> I've been playing with this wonderful shell on a Windows 2000
Pedro> box using the latest version of cygwin and I found a problem
Pedro> when trying to launch two windows consoles (see appended
Pedro> code). While I succeed in the first try the second gives me
Pedro> the following:
Pedro> Error: 13
Pedro> "Permission denied"
Pedro> #{Procedure 12547 (%open in scsh-level-0)}
Pedro> "/var/tmp/13280"
Pedro> 2561
Pedro> 384
Pedro> Any ideas?
Pedro> Thanks in advance,
Pedro> -pp
Pedro> ;;; this is somewhat convoluted but it allows us to set
Pedro> ;;; the console title and to actually pass arguments to
Pedro> ;;; the spawned process
Pedro> (define (launch-windows-console exe args)
Pedro> (let ((cCommand (string-append "start \"" exe "\" " exe " " args
"\nexit\n")))
Pedro> (run (cmd) (<< ,cCommand))))
Pedro> ;; this works
Pedro> (launch-windows-console "dir" "")
Pedro> ;; this will cause the above Permission denied error
Pedro> (launch-windows-console "dir" "")
Scsh tries to open a temporary file to feed the spawned process. As
this file scsh tries to open /var/tmp/(pid)N with N starting at 0. If
the file already exists (open returns errno/exist), scsh tries the
next number for N. The file is deleted as soon as the port is closed.
Cygwin seems to return errno/acces if the file already exists,
maybe you can try to verify this by doing
(open-fdes fname (bitwise-ior open/create open/exclusive) #o600)
where fname is an existing file.
If this is indeed the case the following patch should fix your problem:
Index: scsh.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/scsh.scm,v
retrieving revision 1.36
diff -u -c -r1.36 scsh.scm
*** scsh.scm 15 May 2002 17:05:02 -0000 1.36
--- scsh.scm 18 Jul 2002 07:11:24 -0000
***************
*** 487,493 ****
(let ((fname (format #f template (number->string i))))
(receive retvals (with-errno-handler
((errno data)
! ((errno/exist) #f))
(maker fname))
(if (car retvals) (apply values retvals)
(loop (+ i 1)))))))))
--- 487,493 ----
(let ((fname (format #f template (number->string i))))
(receive retvals (with-errno-handler
((errno data)
! ((errno/exist errno/acces) #f))
(maker fname))
(if (car retvals) (apply values retvals)
(loop (+ i 1)))))))))
Otherwise I need more backtracing information which you can obtain via
the ,preview and ,debug commands as descibed in the S48 manual and at
http://www.scsh.net/docu/debug.html
--
Martin
|