Changeset 1426 for trunk/gsdl/lib


Ignore:
Timestamp:
2000-08-20T20:27:47+12:00 (24 years ago)
Author:
sjboddie
Message:

Added a file_copy function that I needed for the collectoraction

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/fileutil.cpp

    r1419 r1426  
    232232
    233233#endif
     234
     235// I'm sure there's a better way to do this - for now I don't have
     236// time to find it though. -- This will probably break compiling
     237// under windows ports of gcc
     238void file_copy (const text_t &fromfile, const text_t &tofile) {
     239
     240#ifdef __WIN32__
     241char *fromfilec = fromfile.getcstr();
     242char *tofilec = tofile.getcstr();
     243CopyFile (fromfilec, tofilec, FALSE);
     244delete fromfilec;
     245delete tofilec;
     246
     247#else
     248text_t cp_cmd = "cp " + fromfile + " " + tofile;
     249char *cp_cmdc = cp_cmd.getcstr();
     250system (cp_cmdc);
     251delete cp_cmd_c
     252
     253#endif
     254}
  • trunk/gsdl/lib/fileutil.h

    r1419 r1426  
    4949bool read_dir (const text_t &dirname, text_tarray &filelist);
    5050
     51void file_copy (const text_t &fromfile, const text_t &tofile);
     52
    5153#endif
Note: See TracChangeset for help on using the changeset viewer.