Classic ASP Framework
org.classicasp.util.FileUtilEx

[STATIC] File IO utilities.

Summary

Copies one or more directories from one location to another.
Creates a specified directory.
Deletes a specified directory.
Indicates whether a specified directory exists.
Lists sub-directories and files in a specified directory, capable of recursing to a specified depth.
Moves one or more directories from one location to another.
Selects a file.
Copies one or more files from one location to another.
Creates a specified text file, default character set is UTF-8.
Deletes a specified file.
Indicates whether a specified file exists.
Lists files in a specified directory.
Lists files in a specified directory.
Moves one or more files from one location to another.
Determines the name of a file, excluding the path (MYFILE.
Open a specified text file and return the content; capable of detecting ansi, unicode, unicode big-endian, and utf8 character sets.
Open a specified file and return the content.
Determines the path of a file, excluding the filename (C:\MYPATH).
Determines the size of a file.
Opens a specified file and writes it to the client with the appropriate headers (Content-Disposition, Content-Length, ContentType, Filename, etc).
Determines the title of a file, excluding the path and extension (MYFILE).
Determines the type/extension of a file (JPG).
Writes a line of text to specified file, default character set is UTF-8.

DirectoryCopy

Public Function DirectoryCopy(
ByVal sPathSource,
ByVal sPathDestination)
Copies one or more directories from one location to another.

Returns

BooleanEx

DirectoryCreate

Public Function DirectoryCreate(ByVal sPath)
Creates a specified directory.

Returns

BooleanEx

DirectoryDelete

Public Function DirectoryDelete(ByVal sPath)
Deletes a specified directory.

Returns

BooleanEx

DirectoryExists

Public Function DirectoryExists(ByVal sPath)
Indicates whether a specified directory exists.

Returns

BooleanEx

DirectoryList

Public Function DirectoryList(
ByVal sPath,
ByVal lDepth)
Lists sub-directories and files in a specified directory, capable of recursing to a specified depth.

Returns

ArrayEx

DirectoryMove

Public Function DirectoryMove(
ByVal sPathSource,
ByVal sPathDestination)
Moves one or more directories from one location to another.

Returns

BooleanEx

File

Public Function File(ByVal sPath)
Selects a file.

Returns

ObjectEx

FileCopy

Public Function FileCopy(
ByVal sPathSource,
ByVal sPathDestination)
Copies one or more files from one location to another.

Returns

BooleanEx

FileCreate

Public Function FileCreate(
ByVal sPath,
ByVal sContent,
ByVal sCharSet)
Creates a specified text file, default character set is UTF-8.

Returns

BooleanEx

FileDelete

Public Function FileDelete(ByVal sPath)
Deletes a specified file.

Returns

BooleanEx

FileExists

Public Function FileExists(ByVal sPath)
Indicates whether a specified file exists.

Returns

BooleanEx

FileList

Public Function FileList(ByVal sPath)
Lists files in a specified directory.

Returns

ArrayEx

FileListSimple

Public Function FileListSimple(
ByVal sPath,
ByVal nLimit)
Lists files in a specified directory.

Returns

ArrayEx

FileMove

Public Function FileMove(
ByVal sPathSource,
ByVal sPathDestination)
Moves one or more files from one location to another.

Returns

BooleanEx

FileName

Public Function FileName(ByVal sPath)
Determines the name of a file, excluding the path (MYFILE.JPG).

Returns

StringEx

FileOpen

Public Function FileOpen(
ByVal sPath,
ByVal sCharSet)
Open a specified text file and return the content; capable of detecting ansi, unicode, unicode big-endian, and utf8 character sets.

Returns

StringEx

FileOpenBinary

Public Function FileOpenBinary(
ByVal sPath,
ByVal sCharSet)
Open a specified file and return the content.

Returns

BinaryEx

FilePath

Public Function FilePath(ByVal sPath)
Determines the path of a file, excluding the filename (C:\MYPATH).

Returns

StringEx

FileSize

Public Function FileSize(ByVal sPath)
Determines the size of a file.

Returns

NumberEx

FileStream

Public Function FileStream(ByVal sPath)
Opens a specified file and writes it to the client with the appropriate headers (Content-Disposition, Content-Length, ContentType, Filename, etc).

Returns

BooleanEx

FileTitle

Public Function FileTitle(ByVal sPath)
Determines the title of a file, excluding the path and extension (MYFILE).

Returns

StringEx

FileType

Public Function FileType(ByVal sPath)
Determines the type/extension of a file (JPG).

Returns

StringEx

FileWrite

Public Function FileWrite(
ByVal sPath,
ByVal sContent,
ByVal sCharSet)
Writes a line of text to specified file, default character set is UTF-8.

Returns

BooleanEx

'***ClassicASP.org
'Copyright 2010 ClassicASP.org

'This file is part of ClassicASP Framework.

'ClassicASP-Framework is free software: you can redistribute it and/or modify
'it under the terms of the GNU General Public License as published by
'the Free Software Foundation, version 3 of the License.

'ClassicASP-Framework is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.

'You should have received a copy of the GNU General Public License
'along with ClassicASP-Framework. If not, see .

'For additional information please visit .