Hi,
I have a question concerning copy-file on windows. my setup: filesystem on linux mounted over samba on windows I try to copy a file with "copy-file", which is acutaly a symlic link under linux. This results in a .lnk-file. Is there a way to make a real copy of the file?
sorry for the noise, but I think the source of my problem comes from elsewhere. How could I suspect gambit?
Christoph Bauer
Afficher les réponses par date
On 25-Feb-09, at 5:17 AM, Christoph Bauer wrote:
Hi,
I have a question concerning copy-file on windows. my setup: filesystem on linux mounted over samba on windows I try to copy a file with "copy-file", which is acutaly a symlic link under linux. This results in a .lnk-file. Is there a way to make a real copy of the file?
sorry for the noise, but I think the source of my problem comes from elsewhere. How could I suspect gambit?
On Windows Gambit uses the WIN32 CopyFile function. So the semantics of CopyFile is what you are getting when you call copy-file. If you do figure out where the .lnk is coming from please let us know.
Marc
Hi Marc,
On Windows Gambit uses the WIN32 CopyFile function. So the semantics of CopyFile is what you are getting when you call copy-file. If you do figure out where the .lnk is coming from please let us know.
The problem seems to be, that somewhere in my program (which runs under unix also) something like (run-command "ln -s") is called (and I have a cygwin ln in my path) and than later on the result is copied with (copy-file ...), which behaves as is should. So it's all my fault.
But I have another question. Normally on an xterm Ctrl-S stops the output from a program, but it doesn't work with my gambit script. So do I have to catch/enable a signal?
Regard, Christoph
-----Original Message----- From: Marc Feeley [mailto:feeley@iro.umontreal.ca] Sent: Wednesday, February 25, 2009 4:45 PM To: Christoph Bauer Cc: gambit-list@iro.umontreal.ca Subject: Re: [gambit-list] copy-file on windows & links
On 25-Feb-09, at 5:17 AM, Christoph Bauer wrote:
Hi,
I have a question concerning copy-file on windows. my setup: filesystem on linux mounted over samba on
windows I try to
copy a file with "copy-file", which is acutaly a symlic link under linux. This results in a .lnk-file. Is there a way to make a real copy of the file?
sorry for the noise, but I think the source of my problem
comes from
elsewhere. How could I suspect gambit?
On Windows Gambit uses the WIN32 CopyFile function. So the semantics of CopyFile is what you are getting when you call copy-file. If you do figure out where the .lnk is coming from please let us know.
Marc
Christoph Bauer wrote:
But I have another question. Normally on an xterm Ctrl-S stops the output from a program, but it doesn't work with my gambit script. So do I have to catch/enable a signal?
I'm not 100% sure here, but I believe that if you use display, write, or pretty-print, using ctl-s will probably stop your output because these procedures write to the standart output port. On the other hand, the pp procedure writes directly to the terminal, and thus this output cannot be re-directed. So if Ctl-s redirects the stdin/stdout, it is understandable that output from pp is still there.
Did you only used pp to output from your script?
David
Christoph Bauer wrote:
But I have another question. Normally on an xterm Ctrl-S stops the output from a program, but it doesn't work with my gambit
script. So
do I have to catch/enable a signal?
I'm not 100% sure here, but I believe that if you use display, write, or pretty-print, using ctl-s will probably stop your output because these procedures write to the standart output port. On the other hand, the pp procedure writes directly to the terminal, and thus this output cannot be re-directed. So if Ctl-s redirects the stdin/stdout, it is understandable that output from pp is still there.
Did you only used pp to output from your script?
No, I use display. In fact I defined my own output function writeln as:
(define (string-rep obj) (if (string? obj) obj (object->string obj)))
(define (writeln #!rest args) (display (apply string-append (map string-rep args))) (newline))
Most of the output comes from subprocesses. I read the output and use writeln to show it:
(define (run-process-args cmd args #!key (exception-on-status #t) ) (writeln (string-join (cons cmd args))) (let ((port (open-process (list path: cmd arguments: args)))) (letrec ((loop (lambda (acc) (let ((line (read-line port))) (if (eof-object? line) (let ((status (process-status port))) (close-port port) (if (or (not exception-on-status) (= status 0)) acc (raise (list cmd args '=> status)))) (begin (writeln line) (loop (cons line acc)))))))) (reverse (loop '())))))
So I guess most of the time is spent in (read-line).
Christoph