CFLib.org – Common Function Library Project

FileSysLib

Last updated September 19, 2014 / 63 Released UDF(s)
AddPathsToDirectoryQuery

Adds a "FullPath" column to provided directory query. | Requires: CF5

AvailableSpace

Returns the amount of space (in bytes) available to the ColdFusion server for a specified drive or network share. (Windows only) | Requires: CF5

ByteConvert

Pass in a value in bytes, and this function converts it to a human-readable format of bytes, KB, MB, or GB. | Requires: CF5

collectFiles

Scans a directory (or path) for files of a specified extension and then copies them to the path you specify. | Requires: CF6

createUniqueFileName

Creates a unique file name; used to prevent overwriting when moving or copying files from one location to another. | Requires: CF5

deleteDirectory

Recursively delete a directory. | Requires: CF6

deleteEmptyFolder

Delete empty folder from given path. | Requires: CF6

directoryCopy

Copies a directory. | Requires: CF6

DriveExists

Returns True if the specified drive exists on the ColdFusion server. (Windows only) | Requires: CF5

DriveLetter

Returns the drive letter of a physical drive or a network share. (Windows only) | Requires: CF5

DrivePath

Returns the path for the specified drive. (Windows only) | Requires: CF5

DriveType

Returns the drive type for a specified drive. (Windows only) | Requires: CF5

FileCanRead

Checks if a file can be read. | Requires: CF6

FileCanWrite

Checks to see if a file can be written to. | Requires: CF6

FileCreate

Create a new file. | Requires: CF5

FileDateCreated

Returns the date/time a file was created. (Windows only) | Requires: CF5

FileDateLastAccessed

Returns the date/time a file was last accessed. (Windows only) | Requires: CF5

FileDateLastModified

Returns the date/time a file was last modified. (Windows only) | Requires: CF5

FileIsHidden

Returns if a file is hidden or not. | Requires: CF6

FileLastModified

Returns the date the file was last modified. | Requires: CF6

FileNamesLowerCase

Makes all files in a directory lower case. | Requires: CF6

FileRead

Reads a file. | Requires: CF5

FileReadCom

Reads a text file, and returns content as a string. | Requires: CF5

FileSetReadOnly

Makes a file ReadOnly. | Requires: CF6

fileSize

This function will return the length of a file or a directory. | Requires: CF5

FileSizeCom

Returns the size (in bytes) of the specified file. (Windows only) | Requires: CF5

FileSystem

Returns the file system in use on the specified drive. (Windows only) | Requires: CF5

FileType

Returns a string corresponding to the type of file specified. (Windows only) | Requires: CF5

fncFileSize

Will take a number returned from a File.Filesize, calculate the number in terms of Bytes/Kilobytes/Megabytes and return the result. | Requires: CF5

FolderCheck

Will replace chars in a string to be used to create a folder with valid equivalent replacements | Requires: CF5

FolderDateCreated

Returns the date/time a folder (directory) was created. (Windows only) | Requires: CF5

FolderDateLastAccessed

Returns the date/time a folder (directory) was last accessed. (Windows only) | Requires: CF5

FolderDateLastModified

Returns the date/time a folder (directory) was last modified. (Windows only) | Requires: CF5

FolderExists

Returns True if the specified folder (directory) exists on the ColdFusion server. (Windows only) | Requires: CF5

FolderSize

Returns the amount of space (in bytes) of all files and subfolders contained in the specified folder. (Windows only) | Requires: CF5

FolderType

Returns a string corresponding to the type of folder specified. (Windows only) | Requires: CF5

FreeSpace

Returns the amount of free space (in bytes) available to the ColdFusion server for a specified drive or network share. (Windows only) | Requires: CF5

getExtension

Returns extension defined by all characters following last period. | Requires: CF5

GetFileCount

Returns the number of files in a directory. (Windows only) | Requires: CF5

getFileMimeType

Returns the mime type of the specified file. | Requires: CF6

GetHTTPDir

Retrieves the url for the current directory in full or relative format. | Requires: CF5

getRelative

Returns a relative path from the current template to an absolute file path. | Requires: CF5

GetVolumeName

Returns the volume name for the specified drive. (Windows only) | Requires: CF5

IsExtValid

Checks for a valid file extension. | Requires: CF5

IsReady

Returns True if the specified drive is ready. (Windows only) | Requires: CF5

IsRootFolder

Returns True if the specified folder is the root folder. (Windows only) | Requires: CF5

makeDirs

Create all non exitant directories in a path. | Requires: CF6

makeUriFromPath

Creates a URI from an absolute path. | Requires: CF5

normalizeFilePath

normalizes a file path to remove invalid slashes and extra dots. | Requires: CF6

relativeFilePath

Calculate the relative path from startFile to endFile. | Requires: CF5

ripExt

Function returns filename without extension. | Requires: CF5

SerialNumber

Returns the serial number for the specified drive. (Windows only) | Requires: CF5

SetFileAttribute

Function to set or clear a Windows file attribute (ReadOnly, Hidden, etc) for the specified file. | Requires: CF5

setFileDate

Updates the dateLastModified file attribute. | Requires: CF9

SetReadOnly

Convenience function to set/clear the ReadOnly attribute for the specified file. | Requires: CF5

SetVolumeName

Sets the volume name for the specified drive. (Windows only) | Requires: CF5

ShareName

Returns the network share name for the specified drive. (Windows only) | Requires: CF5

TotalSize

Returns the total size (in bytes) of a specified drive or network share. (Windows only) | Requires: CF5

UniqueFilename

Creates a unique filename from a passed prefix, file extension and current date/time. | Requires: CF5

unzipFile

Unzips a file to the specified directory. | Requires: CF6

UpDirLevel

Climbs up a given UNC Path a specified number of levels. | Requires: CF5

WriteFileAndDirectories

Automatically creates any missing directories before writing to the specified file. | Requires: CF6

ZipFileNew

Create a zip file of a directory or just a file. | Requires: CF6

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson