Secciones de la página

dir. tol


Declaraciones


Funciones


Time oriented language


Árbol de ficheros

Funciones

Set DirFiles()

Set DirAll()

Real DirUsage()

Tol

Artículos del sitio

Presentación de Tol

Todos los programas

Simuladores visuales

Sitios que me gustan

Por categorías

Algoritmia

Búsqueda y ordenación

Computación fisiológica

Editorial y edición

Gráficos de datos

Herramientas y utilidades

Hipertexto

Informática forense

Lectura óptica de datos

Metaprogramación

No determinista

Ofimática

Recursión e iteración

Reglas y restricciones

Series y estadística









dir.tol de Ink.Watercolor

Directories functions.

Declaraciones

Funciones

  • Set DirFiles(Text dir, Text filPattern, Real toLower, Real casSen)
    Returns a set of files paths with all the files inside dir (not in its subdirectories) that theirs names match with file pattern filPattern. If toLower is true all names are change to lower case. If casSen is true then the match is case sensitive. The power of pattern matching is the same than TOL funcion TextMatch().
  • Set DirAll(Text dir, Text filPattern, Real toLower, Real casSen)
    Returns a set of files paths with all the files inside dir and all of its subdirectories that theirs names match with file pattern filPattern. If toLower is true all names are change to lower case. If casSen is true then the match is case sensitive. The power of pattern matching is the same than TOL funcion TextMatch().
  • Real DirUsage(Text dir, Text filPattern, Real casSen)
    Returns the sum in bytes of the size of the set of files inside dir and all of its subdirectories that theirs names match with filPattern. Example, usage in bytes of all gif files inside a web directory at any level: Real gifSiz = DirUsage(<web>,<*.gif>, FALSE);

Funciones

Set DirFiles()

//////////////////////////////////////////////////////////////////////////////
Set DirFiles(Text dir,        // Directory path
             Text filPattern, // File names pattern
             Real toLower,    // If true all names to lower case
             Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(DirExist(dir)), Empty,
  {
    Set  getDir = GetDir(dir);
    Set  filSet = getDir[1];

    Set  filFnd = EvalSet(filSet, Text(Text fil)
    {
      If(TextMatch(fil,filPattern,casSen),
         If(toLower, ToLower(dir+"/"+fil), dir+"/"+fil),
         "")
    });

    Set filSel = Select(filFnd, Real(Text fil) { fil!="" });

    filSel
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set of files paths with all the files inside dir (not in its
subdirectories) that theirs names match with file pattern filPattern.
If toLower is true all names are change to lower case.
If casSen is true then the match is case sensitive.
The power of pattern matching is the same than TOL funcion TextMatch().",
DirFiles);
//////////////////////////////////////////////////////////////////////////////

Set DirAll()

//////////////////////////////////////////////////////////////////////////////
Set DirAll(Text dir,        // Directory path
           Text filPattern, // File names pattern
           Real toLower,    // If true all names to lower case
           Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(DirExist(dir)), Empty,
  {
    Set  getDir = GetDir(dir);
    Set  filSet = getDir[1];
    Set  dirSet = getDir[2];

    Set  filFnd = EvalSet(filSet, Text(Text fil)
    {
      If(TextMatch(fil,filPattern,casSen),
         If(toLower, ToLower(dir+"/"+fil), dir+"/"+fil),
         "")
    });

    Set filSel = Select(filFnd, Real(Text fil) { fil!="" });

    Set  dirFnd = EvalSet(dirSet, Set(Text subDir)
      { DirAll(dir+"/"+subDir, filPattern, toLower, casSen) });

    Real dirCar   = Card(dirFnd);
    If(EQ(dirCar,0), filSel,
    If(EQ(dirCar,1), filSel<<dirFnd[1],
                     filSel<<BinGroup("+",dirFnd)))
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set of files paths with all the files inside dir and all of its
subdirectories that theirs names match with file pattern filPattern.
If toLower is true all names are change to lower case.
If casSen is true then the match is case sensitive.
The power of pattern matching is the same than TOL funcion TextMatch().",
DirAll);
//////////////////////////////////////////////////////////////////////////////

Real DirUsage()

//////////////////////////////////////////////////////////////////////////////
Real DirUsage(Text dir,        // Directory path
              Text filPattern, // File names pattern
              Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  Set  filSet = DirAll(dir, filPattern, FALSE, casSen);
  If(EQ(Card(filSet),0), 0, SetSum(EvalSet(filSet, FileBytes)))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns the sum in bytes of the size of the set of files inside dir and all
of its subdirectories that theirs names match with filPattern.
Example, usage in bytes of all gif files inside a web directory at any level:
  Real gifSiz = DirUsage(<web>,<*.gif>, FALSE);",
DirUsage);
//////////////////////////////////////////////////////////////////////////////

Time oriented language

//////////////////////////////////////////////////////////////////////////////
// FILE    : dir.tol
// AUTHOR  : http://www.asolver.com
// PURPOSE : Directories functions.
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set DirFiles(Text dir,        // Directory path
             Text filPattern, // File names pattern
             Real toLower,    // If true all names to lower case
             Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(DirExist(dir)), Empty,
  {
    Set  getDir = GetDir(dir);
    Set  filSet = getDir[1];

    Set  filFnd = EvalSet(filSet, Text(Text fil)
    {
      If(TextMatch(fil,filPattern,casSen),
         If(toLower, ToLower(dir+"/"+fil), dir+"/"+fil),
         "")
    });

    Set filSel = Select(filFnd, Real(Text fil) { fil!="" });

    filSel
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set of files paths with all the files inside dir (not in its
subdirectories) that theirs names match with file pattern filPattern.
If toLower is true all names are change to lower case.
If casSen is true then the match is case sensitive.
The power of pattern matching is the same than TOL funcion TextMatch().",
DirFiles);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set DirAll(Text dir,        // Directory path
           Text filPattern, // File names pattern
           Real toLower,    // If true all names to lower case
           Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(DirExist(dir)), Empty,
  {
    Set  getDir = GetDir(dir);
    Set  filSet = getDir[1];
    Set  dirSet = getDir[2];

    Set  filFnd = EvalSet(filSet, Text(Text fil)
    {
      If(TextMatch(fil,filPattern,casSen),
         If(toLower, ToLower(dir+"/"+fil), dir+"/"+fil),
         "")
    });

    Set filSel = Select(filFnd, Real(Text fil) { fil!="" });

    Set  dirFnd = EvalSet(dirSet, Set(Text subDir)
      { DirAll(dir+"/"+subDir, filPattern, toLower, casSen) });

    Real dirCar   = Card(dirFnd);
    If(EQ(dirCar,0), filSel,
    If(EQ(dirCar,1), filSel<<dirFnd[1],
                     filSel<<BinGroup("+",dirFnd)))
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set of files paths with all the files inside dir and all of its
subdirectories that theirs names match with file pattern filPattern.
If toLower is true all names are change to lower case.
If casSen is true then the match is case sensitive.
The power of pattern matching is the same than TOL funcion TextMatch().",
DirAll);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Real DirUsage(Text dir,        // Directory path
              Text filPattern, // File names pattern
              Real casSen)     // If true case sensitive in file names
//////////////////////////////////////////////////////////////////////////////
{
  Set  filSet = DirAll(dir, filPattern, FALSE, casSen);
  If(EQ(Card(filSet),0), 0, SetSum(EvalSet(filSet, FileBytes)))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns the sum in bytes of the size of the set of files inside dir and all
of its subdirectories that theirs names match with filPattern.
Example, usage in bytes of all gif files inside a web directory at any level:
  Real gifSiz = DirUsage(<web>,<*.gif>, FALSE);",
DirUsage);
//////////////////////////////////////////////////////////////////////////////

Árbol de ficheros

Ink.Watercolor construye las páginas del sitio web inkwatercolor.com

  • make.tol proceso principal de generación de contenidos del sitio web
  • tol directorios de código fuente en lenguaje de programación Tol
    • cmm funciones comunes de textos, fechas, conjuntos, ficheros, etc.
      • txt.tol funciones de manejo de textos
      • set.tol funciones de manejo de conjuntos
      • tab.tol funciones de tablas como set of sets
      • ser.tol funciones de series temporales
      • fil.tol funciones de gestión de ficheros
      • zip.tol compresor de ficheros en línea de mandatos
      • apa.tol proceso de ficheros de log de Apache
      • dir.tol funciones de gestión de directorios
    • app funciones especificas de Ink.Watercolor
      • pdb.tol funciones de la base de datos de pinturas
      • pag.tol funciones para generar páginas web Html
      • sed.tol semillas, templates, de páginas web Html
      • ftp.tol funciones para generar mandatos para hacer Ftp
      • xml.tol funciones históricas para sitemaps en Xml
      • alc.tol alchemy para la transformación de imágenes
      • ink.tol funciones auxiliares de InkWatercolor
    • inc.tol inclusión de los ficheros Tol básicos y de aplicación
  • agenda directorio destinado a albergar los ficheros de agendas de posts
    • chpphodb01.txt ejemplo con las 4 primeras obras artísticas que se incluyeron
  • web directorio destinado a las paginas web generadas automáticamente
    • common directorio de recursos comunes a todas las galerías
      • css directorio para ficheros de estilo
        • common.css fichero de estilo para las paginas Html del sitio web
      • seed trozos de código Html para construir templates
        • strseed.htm estructura básica de página Html de inkwatercolor.com
        • pi1lowseed.htm estructura para albergar información sobre una obra
        • pi4cntseed.htm estructura para albergar 4 pinturas en una página
      • src directorio para ficheros javascript
    • chppho directorio para la galería principal de Inkwatercolor
      • index.html ejemplo de página Html generada automáticamente
    • download directorio para material extra para descargas
      • chppho0129.jpg ejemplo de imagen de obra artística para descargar
      • chppho0143.jpg ejemplo de imagen de obra artística para descargar
    • sitemap.xml mapa del sitio web generado en Xml de forma automática
  • history archivo de registro histórico del programa Ink.Watercolor
  • ink_watercolor.pdf documento resumen de funciones del programa de generación Html

2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio

Tol