How to use File Attributes at 4.0+

Looking for an example project to get you started?

How to use File Attributes at 4.0+

Postby Support_Duane » Mon Feb 20, 2012 6:50 pm

This project that will write out the file attributes of a named file to the joblog. Modify the value of the first variable to a file that exists on your system and it should work as is.

Code: Select all
<project name="FileList Attributes" mainModule="Main" version="2.0" logLevel="silent">

   <module name="Main">

      <setVariable label="Init thisFile" name="thisFile" value="\temp\DirList.txt" version="2.0" />

      <setVariable label="Init path" name="path" value="${FileInfo(thisFile):parentFile}" version="2.0" />

      <setVariable label="Init badPath" name="badPath" value="${FileInfo(thisFile):parentFile}/notHere" version="2.0" />

      <print label="Print File Info to JobLog" version="1.0">
thisFile     = ${ thisFile }
path         = ${ path }
badPath      = ${ badPath}
    ** Attribute List **
    "thisFile" exists:                        ${ FileInfo(thisFile):exists }
    "path" exists:                            ${ fileInfo( path ):exists }
    "badPath" exists:                         ${ fileInfo( badPath ):exists }
    "thisFile" name:                          ${ FileInfo( thisFile ):name }
    "thisFile" extension:                     ${ FileInfo( thisFile ):extension }
    "thisFile" last modified date:            ${ FileInfo( thisFile ):lastModifiedDate }
    "thisFile" size:                          ${ FileInfo( thisFile ):size }
     "thisFile" path:                         ${ FileInfo( thisFile ):path }
    "thisFile" nameWithoutExtension:          ${ FileInfo( thisFile ):nameWithoutExtension }
    parentFile:                               ${ FileInfo( thisFile ):parentFile }


   <description>Print File List Attributs to Job Log</description>

Support Specialist
Posts: 65
Joined: Thu Mar 05, 2009 3:49 pm

Return to Example Projects

Who is online

Users browsing this forum: No registered users and 1 guest