From b22f596ce449869bffd8e0f63baee1c53e20fa06 Mon Sep 17 00:00:00 2001 From: jofret Date: Tue, 28 Apr 2009 07:11:01 +0000 Subject: Moving macros here --- macros/ToolInitialization/INIT_RemoveDirs.sci | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 macros/ToolInitialization/INIT_RemoveDirs.sci (limited to 'macros/ToolInitialization/INIT_RemoveDirs.sci') diff --git a/macros/ToolInitialization/INIT_RemoveDirs.sci b/macros/ToolInitialization/INIT_RemoveDirs.sci new file mode 100644 index 00000000..0fa288bd --- /dev/null +++ b/macros/ToolInitialization/INIT_RemoveDirs.sci @@ -0,0 +1,65 @@ +function INIT_RemoveDirs(FileInfo,SharedInfoRunMode) +// function INIT_RemoveDirs(FileInfo,SharedInfoRunMode) +// ----------------------------------------------------------------- +// #RNU_RES_B +// Removes existing directories according to the RunMode +// specified by the user. +// +// Input data: +// FileInfo: structure containing all info about SCI2C files. +// SharedInfoRunMode: execution mode specified by the user in +// the SCI2CInputParameters.sce file. +// +// Output data: +// --- +// +// #RNU_RES_E +// Status: +// 03-Jan-2008 -- Raffaele Nutricato: Author. +// +// Copyright 2008 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +// ---------------------------------------------------- +// --- Remove previous versions of SCI2C files/dir. --- +// ---------------------------------------------------- +if (SharedInfoRunMode == 'GenLibraryStructure' | SharedInfoRunMode == 'All') + disp('Removing directory: '+FileInfo.WorkingDir); + disp('Removing directory: '+FileInfo.OutCCCodeDir); + // Remove software<->user interaction. + // yesno=input('Are you sure [y/n]?','string'); + yesno = 'y'; + if (yesno=='y') + rmdir(FileInfo.WorkingDir,'s'); + rmdir(FileInfo.OutCCCodeDir,'s'); + else + SCI2Cerror('Cannot continue, because you don''t want to delete: '+FileInfo.WorkingDir); + SCI2Cerror('Cannot continue, because you don''t want to delete: '+FileInfo.OutCCCodeDir); + end +elseif (SharedInfoRunMode == 'Translate') + // #RNU_RES_B + //NUT: non cancella le cartelle dei file C creati nella iterazione precedente + //NUT: occorre specificarlo bene nel manuale. + // #RNU_RES_E + disp('Removing directory: '+FileInfo.OutCCCodeDir); + // Remove software<->user interaction. + // yesno=input('Are you sure [y/n]?','string'); + yesno = 'y'; + if (yesno=='y') + rmdir(FileInfo.OutCCCodeDir,'s'); + else + SCI2Cerror('Cannot continue, because you don''t want to delete: '+FileInfo.OutCCCodeDir); + end +else + disp('Unknown RunMode: ""'+SharedInfoRunMode+'"".'); + disp('Please check RunMode parameter in the SCI2CInputParameters.sce file'); + SCI2Cerror(' '); +end + +endfunction -- cgit