source: trunk/UTILITAIRE/cp.pro @ 2

Last change on this file since 2 was 2, checked in by opalod, 22 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME: cp
6;
7; PURPOSE: copy files
8;
9; CATEGORY: commande unix
10;
11; CALLING SEQUENCE: cp, filenamein, filenameout
12;
13; INPUTS:filenamein, filenameout: 2 strings.
14;
15; KEYWORD PARAMETERS:
16;
17; OUTPUTS:
18;
19; COMMON BLOCKS:
20;
21; SIDE EFFECTS:
22;
23; RESTRICTIONS:
24;
25; EXAMPLE:
26;
27; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
28;
29;-
30;------------------------------------------------------------
31;------------------------------------------------------------
32;------------------------------------------------------------
33PRO cp, filenamein, filenameout
34;
35   if size(filenamein, /type) NE 7 then begin
36      rien = report('filenamein must be a string')
37      return
38   endif
39   if size(filenameout, /type) NE 7 then begin
40      rien = report('filenameout must be a string')
41      return
42   endif
43;
44   thisOS = strupcase(strmid(!version.os_family, 0, 3))
45   if thisOS eq 'MAC' or thisOS eq 'WIN' then begin
46      text = getfile(filenamein)
47      putfile, filenameout, text
48   ENDIF ELSE spawn, 'cp '+filenamein+' '+filenameout
49
50   return
51end
Note: See TracBrowser for help on using the repository browser.