FileHelper
Contains helper function which allow to deal with files and directories.
Functions and values
Function or value | Description |
allFiles(path)
Signature: path:string -> bool
|
Includes all files |
AppendTextFiles newFileName files
Signature: newFileName:string -> files:seq<string> -> unit
|
Appends all given files to one file. Parameters
|
changeExt extension fileName
Signature: extension:string -> fileName:string -> string
|
Change the extension of the file. Parameters
|
CleanDir(path)
Signature: path:string -> unit
|
Cleans a directory by removing all files and sub-directories. |
CleanDirs(dirs)
Signature: dirs:seq<string> -> unit
|
Cleans multiple directories |
CompareFiles(...)
Signature: delete:bool -> originalFileName:string -> compareFileName:string -> bool
|
Compares the given files for changes. If delete is set to true then equal files will be removed. |
Copy target files
Signature: target:string -> files:seq<string> -> unit
|
Copies the files to the target. Parameters
|
CopyCached target cacheDir files
Signature: target:string -> cacheDir:string -> files:seq<string> -> string list
|
Copies the files from a cache folder. If the files are not cached or the original files have a different write time the cache will be refreshed. Parameters
|
CopyDir target source filterFile
Signature: target:string -> source:string -> filterFile:(string -> bool) -> unit
|
Copies a directory recursivly. If the target directory does not exist, it will be created. Parameters
|
CopyFile target fileName
Signature: target:string -> fileName:string -> unit
|
Copies a single file to the target and overwrites the existing file. Parameters
|
CopyFileIntoSubFolder target fileName
Signature: target:string -> fileName:string -> unit
|
Copies a single file to a relative subfolder of the target. Parameters
|
CopyFiles target files
Signature: target:string -> files:seq<string> -> unit
|
Copies the files to the target - Alias for Copy Parameters
|
CopyFileWithSubfolder(...)
Signature: baseDir:string -> target:string -> fileName:string -> unit
|
Copies a single file to the target folder preserving the folder structure starting from the specified base folder. Parameters
|
copyRecursive dir outputDir overwrite
Signature: dir:DirectoryInfo -> outputDir:DirectoryInfo -> overwrite:bool -> string list
|
Copies the file structure recursively. |
CopyRecursive dir outputDir
Signature: dir:string -> outputDir:string -> bool -> string list
|
Copies the file structure recursively. |
CopyTo target files
Signature: target:string -> files:seq<string> -> unit
|
Copies the given files to the target. Parameters
|
CopyWithSubfoldersTo target files
Signature: target:string -> files:seq<FileIncludes> -> unit
|
Copies several file groups, each represented by a FileIncludes object, to the target folder preserving the folder structure starting from the BaseDirectory of each FileIncludes. Parameters
|
CreateDir(path)
Signature: path:string -> unit
|
Creates a directory if it does not exist. |
CreateFile(fileName)
Signature: fileName:string -> unit
|
Creates a file if it does not exist. |
DeleteDir(path)
Signature: path:string -> unit
|
Deletes a directory if it exists. |
DeleteDirs(dirs)
Signature: dirs:seq<string> -> unit
|
Deletes multiple directories |
DeleteFile(fileName)
Signature: fileName:string -> unit
|
Deletes a file if it exists. |
DeleteFiles(files)
Signature: files:seq<string> -> unit
|
Deletes the given files. |
directory(path)
Signature: path:string -> string
|
Get the directory of the specified path Parameters
|
excludeSVNFiles(path)
Signature: path:string -> bool
|
Exclude SVN files (path with .svn) |
ext(fileName)
Signature: fileName:string -> string
|
Get the filename extension including the leading '.', or an empty string if the file has no extension. Parameters
|
filename(path)
Signature: path:string -> string
|
Get the filename for the specified path Parameters
|
filenameWithouExt(path)
Signature: path:string -> string
Attributes: [<Obsolete("This was a typo - please use fileNameWithoutExt")>] |
OBSOLETEThis was a typo - please use fileNameWithoutExt |
fileNameWithoutExt(path)
Signature: path:string -> string
|
Get the filename for the specified path without it's extension Parameters
|
FilesAreEqual first second
Signature: first:FileInfo -> second:FileInfo -> bool
|
Checks if the two files are byte-to-byte equal. |
FileVersion(fileName)
Signature: fileName:string -> string
|
Get the version a file. Parameters
|
GeneratePatch(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> unit
|
Checks the srcFiles for changes to the last release. Parameters
|
GeneratePatchWithFindOldFileFunction(...)
Signature: lastReleaseDir:string -> patchDir:string -> srcFiles:seq<string> -> findOldFileF:(string -> string -> string) -> unit
|
Checks the srcFiles for changes to the last release. Parameters
|
hasExt extension fileName
Signature: extension:string -> fileName:string -> bool
|
Tests whether the file has specified extensions (containing the leading '.') Parameters
|
MoveFile target fileName
Signature: target:string -> fileName:string -> unit
|
Moves a single file to the target and overwrites the existing file. Parameters
|
ReadCSVFile(file)
Signature: file:string -> seq<string []>
|
Reads a csv file line by line delimiter is a , |
recursively dirF fileF dir
Signature: dirF:(DirectoryInfo -> unit) -> fileF:(FileInfo -> unit) -> dir:DirectoryInfo -> unit
|
Performs the given actions on all files and subdirectories |
RegexReplaceInFilesWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> files:seq<string> -> unit
|
Replace all occurences of the regex pattern with the given replacement in the specified files Parameters
|
RegexReplaceInFileWithEncoding(...)
Signature: pattern:string -> replacement:string -> encoding:Encoding -> file:string -> unit
|
Replace all occurences of the regex pattern with the given replacement in the specified file Parameters
|
Rename target fileName
Signature: target:string -> fileName:string -> unit
|
Renames the file or directory to the target name. Parameters
|
ReplaceInFiles replacements files
Signature: replacements:seq<string * string> -> files:seq<string> -> unit
|
Replaces all occurences of the patterns in the given files with the given replacements. Parameters
|
setDirectoryReadOnly readOnly dir
Signature: readOnly:bool -> dir:DirectoryInfo -> unit
|
Sets the directory readonly |
SetDirReadOnly readOnly dir
Signature: readOnly:bool -> dir:DirectoryInfo -> unit
|
Sets all files in the directory readonly. |
SetReadOnly readOnly files
Signature: readOnly:bool -> files:seq<string> -> unit
|
Sets all given files readonly. |
SilentCopy target files
Signature: target:string -> files:seq<string> -> unit
|
Copies a list of files to the specified directory without any output. Parameters
|
TestDir(path)
Signature: path:string -> bool
|
Checks if the directory exists |
TestFile(path)
Signature: path:string -> bool
|
Checks if the file exists |
WriteConfigFile(...)
Signature: configFileName:string -> parameters:seq<'?12981 * '?12982> -> unit
Type parameters: '?12981, '?12982 |
Creates a config file with the parameters as "key;value" lines |
Active patterns
Active pattern | Description |
( |EndsWith|_| ) extension file
Signature: extension:string -> file:string -> unit option
|
Active Pattern for determining file extension. |
( |File|Directory| )(fileSysInfo)
Signature: fileSysInfo:FileSystemInfo -> Choice<FileInfo,(DirectoryInfo * IEnumerable<FileSystemInfo>)>
|
Active pattern which discriminates between files and directories. |
( |FileInfoFullName| )(f)
Signature: f:FileInfo -> string
|
Active Pattern for determining file name. |
( |FileInfoNameSections| )(f)
Signature: f:FileInfo -> string * string * string
|
Active Pattern for determining FileInfoNameSections. |