Ignore:
Timestamp:
Oct 26, 2008, 10:33:12 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
e7bf535
Parents:
8958dab
Message:

New function OSFilCat that concats a set of files in a new one

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@79 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/general/system/_system.tol

    r8958dab r231d038  
    1616// OSFilCopy:   Copies a file to other directory or with a different name.
    1717// OSFilMove:   Moves a file to other directory or with a different name.
     18// OSFilCat:    Cats a set of files into a new one.
    1819// OSDirExist:  Cheks if a folder exists
    1920// OSDirMake:   Creates a directory and all its non existent parents
    … …  
    364365    OSPathQt(oldFil)+" "+OSPathQt(newFil));
    365366  OSShowErr(ok,call)
    366 
    367367};
    368368//////////////////////////////////////////////////////////////////////////////
    … …  
    396396En caso de error devuelve FALSO y si no CIERTO"),
    397397OSFilMove);
     398//////////////////////////////////////////////////////////////////////////////
     399
     400//////////////////////////////////////////////////////////////////////////////
     401Real OSFilCat(Set oldFiles, Text newFil)
     402//////////////////////////////////////////////////////////////////////////////
     403{
     404  Text call = "OSFilCat("<<oldFiles+","+newFil+")";
     405  Text OSTrace(3,call);
     406  Real ok = OSCmdWait(If(OSUnix,
     407  {
     408    "cat"+SetSum(For(1,Card(oldFiles),Text(Real k)
     409    {
     410      " "+OSPathQt(oldFiles[k])
     411    }))+" > "+OSPathQt(newFil)
     412  },
     413  {
     414    "copy "+SetSum(For(1,Card(oldFiles),Text(Real k)
     415    {
     416      If(k==1,"","+")+OSPathQt(oldFiles[k])
     417    }))+" "+OSPathQt(newFil)
     418  }));
     419  OSShowErr(ok,call)
     420};
     421//////////////////////////////////////////////////////////////////////////////
     422PutDescription(I2(
     423"Copies a set of files to a new one.
     424Returns TRUE if success or FALSE if an error happens",
     425"Copia un conjunto ficheros en uno nuevo.
     426En caso de error devuelve FALSO y si no CIERTO"),
     427OSFilCat);
    398428//////////////////////////////////////////////////////////////////////////////
    399429
Note: See TracChangeset for help on using the changeset viewer.