[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Script crash at FileCopy after call to a XCMD



In the following MacPerl script I am calling an external routine (XCMD ressource code) in order to display an dialog and let the user input some text data.
As input parameter the external routine takes a string, used as prompt in the dialog box, and returns also a string containing the concatenation of the field's data separated by a ":" char.
This works pretty well except that the script crash later at the calling of the function MacPerl'FileCopy.

#! perl

# Test case, MacPerl droplet, 96.09.30 Michel Bovey # Why does this script make the system to crash after issuing the FileCopy routine ?

require "StandardFile.pl";
require "FileCopy.pl";

unless (&MacPerl'LoadExternals("Boum.XCMD")) {    die "Can't load ÇBoum.XCMDÈ";
}
$src_file = $ARGV[0];
$dest_folder = "HD By:FR:ARCHIVES.FR";  # parameter depending on the user
$dummy_str = &DocInput( "Please enter some data in some fields" );
&MacPerl'Answer("given data is Ç$dummy_strÈ, now try to make a copy", "continue" );
$result = &MacPerl'FileCopy( $src_file, $dest_folder,1  );
&MacPerl'Answer("result: Ç$resultÈ", "Quit" );
exit;

# end of script


I am using version 5.0.7 of MacPerl on PPC and the XCMD ressource code was compiled with the C compiler of CodeWarrior 9 (sources available on request).
Can somebody try to explain what goes wrong ?
Thanks

Michel Bovey

*******************************************************
Michel Bovey, IT, International Bureau of the Universal Postal Union
Weltpostrasse 4, 3000 Bern 15, Switzerland
Tel.: +41 31 350 3388            Fax: +41 31 350 3110
email: michel.bovey@ib.upu.org   www: http://ibis.ib.upu.org/
*******************************************************