| A. Files | B. Directories | C. Disks/Drives | D. File I/O | E. Stream I/O | F. Port I/O |
See Sections D and E for details of reading or writing files.
(
Bookmark)
| Topic | Description | Unit | ||||||||||||||||||||||||
| Application.EXEname | Filename of the executable application including path
information. Same as ParamStr(0) |
Forms | ||||||||||||||||||||||||
| Text Files in Delphi: Handling ASCII files from Object
Pascal code http://delphi.about.com/compute/delphi/library/weekly/aa110999.htm ASCII Made Easy: Manipulating ASCII Files with the Table Component, Delphi Informant, Cary Jensen, June 1999, pp. 26-32 Delphi Import/Export: Part I: Getting Data into, and out of, ASCII Text Files, Delphi Informant, May 1998 Read a text file backwards efg's Resource Demo application shows how to use the following file types in resource files: BMP, ICO, JPG, GIF (requires Anders Melander's TGIFImage), EMF, TXT, AVI, WAV and cursors Fastest way to search a string in a file ASCII Codes Deepak Shenoy's UseNet Post with file stream example of converting UNIX text to DOS text |
||||||||||||||||||||||||||
| Attributes | See File Attributes | |||||||||||||||||||||||||
| Browse for Files | See Find Files | |||||||||||||||||||||||||
| BrowseForFolder | Procedure BrowseForFolder is in the FMXUtils.PAS unit of Neil Rubenking's update to PC Magazine utility WMatch32,18 March 1999, which compare directories side-by-side | |||||||||||||||||||||||||
| Changes | Detect changes in files. File Notification: VB or Delphi: Which Does COM Automation Best?, Delphi Informant, April 1998. Discusses functions FindFirstChangeNotification, FindNextChangeNotification, and FindCloseChangeNotification. TDirectoryWatch Antonio's UseNet Post with "efficient" way to wait for a file (FindFirstChangeNotification, FindNextChangeNotification, FindCloseChangeNotification |
|||||||||||||||||||||||||
| ChangeFileExt | function ChangeFileExt(const
FileName, Extension: string): string; Changes the extension of a filename. The new extension can be a an empty string or a period followed by up to three characters See example with INI Files (below) |
SysUtils | ||||||||||||||||||||||||
| Checking if file is in use | www.bhnet.com.br/~simonet/tipstricks/fileinuse.htm
Also see ExclusiveIO in File I/O section. |
|||||||||||||||||||||||||
| TDiff http://www.users.on.net/johnson/delphi Peter Below's (Team B) Usenet Post with sample code using TMemoryStreams and CompareMem to compare files. Neil Rubenking's PC Magazine utility WMatch32,18
March 1999, Ralph Friedman's (Team B) UseNet Post with sample code using TFileStreams TFileCompare is a simple class for comparing the contents one file with
another. A two files identical? Do a 32 bit CRC-sum? Compare files probabilistically using CRCs. See the CRC Lab Report. For comparison of bitmaps, see Comparison on efg's Delphi Graphics Algorithms: Image Processing page. |
||||||||||||||||||||||||||
| Compression | Turobpower's Abbrevia www.turbopower.com/products/abbrevia XCeed ZIP Paszlib List of Components |
|||||||||||||||||||||||||
| Concat Files | Peter Below's UseNet Post with ConcatFiles procedure | |||||||||||||||||||||||||
// Wrapper for Windows API CopyFile
FUNCTION CopyFile(CONST SourceFile : TFilename;
CONST DestinationFile: TFilename): BOOLEAN;
BEGIN
RESULT := Windows.CopyFile(pChar(SourceFile),
pChar(DestinationFile),
FALSE {Fail if Exists});
END {CopyFile};
Petr Jenicek reports in a UseNet post that when copying files to a network drive, CopyFile does not return error code ERROR_DISK_FULL but ERROR_ACCESS_DENIED (5). |
Windows | |||||||||||||||||||||||||
| Copying Files | How do I copy a file? (Three examples: File Streams,
Block Read/Write, LZCopy), Borland TI 910D
Copying a directory of a set of files Copy, Move and Delete Files or Folders in Windows 95 just like Explorer does, Showing flying Files. Interact with Recent Documents and Recycle Bin. www.xploiter.com/programming/delphi/files/flying.zip |
|||||||||||||||||||||||||
| CRC |
|
|||||||||||||||||||||||||
| DateTimeToFileDate | Look for example on efg's Dates and Times page | SysUtils | ||||||||||||||||||||||||
| function DeleteFile(const FileName:
string): Boolean; Erase the specified file. To delete a Read/Only file, use FileSetAttr to change the attribute to read/write then DeleteFile to delete the file. See: |
SysUtils | |||||||||||||||||||||||||
| Deleting | Deleting a directory or a set of files http://members.xoom.com/_XOOM/jescott/DelphiCodeTips1.html#DeleteAllFiles |
|||||||||||||||||||||||||
| Deleting lines in text file | Neil Rubenking's UseNet Post about how to delete a line in an ASCII text file | |||||||||||||||||||||||||
| Delphi Files | Delphi Configuration Files, TI 1105D Delphi 3 file types with descriptions, TI1552D "Error reading symbol file" error, FAQ 812D How can I convert a .dfm file to text and vice versa, FAQ 1151D |
|||||||||||||||||||||||||
| Diff | Syntax oriented diff tools. Compare two Delphi
source file and report all changes. Skip comments. Insensitive to change
comments, cases and reformat sources (add/remove spaces or/and empty
lines). http://delphi.icm.edu.pl/ftp/tools/pasdiffp.exe Also see Comparing Files |
|||||||||||||||||||||||||
| Directories | efg's Directories page | |||||||||||||||||||||||||
| DragAcceptFiles, DragQueryFile |
Drag and Drop with Files, FAQ 529D | |||||||||||||||||||||||||
| ExcludeTrailingBackslash (D5) |
function
ExcludeTrailingBackslash(const S: string): string; Use ExcludeTrailingBackslash to modify a path name (specified by the S parameter) so that it does not end with a backslash character (\). If S does not end in a backslash character, ExcludeTrailingBackslash returns a copy of S. |
SysUtils | ||||||||||||||||||||||||
| EXE Date |
// Use EXE Date as program version number
FUNCTION GetEXEDate: STRING;
VAR
DateTime : TDateTime;
ReturnCode: INTEGER;
SearchRec : TSearchRec;
BEGIN
ReturnCode := FindFirst(ParamStr(0), faAnyFile, SearchRec);
TRY
IF ReturnCode = 0
THEN DateTime := FileDateToDateTime(SearchRec.Time)
ELSE DateTime := 0
FINALLY
FindClose(SearchRec);
END;
RESULT := FormatDateTime('mm/dd/yyyy hh:nn:ss', DateTime)
END;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('EXE=' + ParamStr(0) + ', ' +
'Date = ' + GetEXEDate );
end;
|
|||||||||||||||||||||||||
| ExpandFileName | function ExpandFileName(const
FileName: string): string; ExpandFileName converts the relative file name into a fully qualified path name by merging in the current drive and directory. A fully qualified path name includes the drive letter and any directory and subdirectories in addition to the file name and extension. ExpandFileName does not verify that the resulting fully qualified path name refers to an existing file, or even that the resulting path exists. |
SysUtils | ||||||||||||||||||||||||
| ExpandUNCFileName | function
ExpandUNCFileName(const FileName: string): string; Expands the given filename to a fully qualified filename. This function is the same as ExpandFileName except that it will return the drive portion of the filename in the format '\\<servername>\<sharename> if that drive is actually a network resource instead of a local resource. Example: |
SysUtils | ||||||||||||||||||||||||
| ExtractFileDir | function ExtractFileDir(const
FileName: string): string; The resulting string is a directory name suitable for passing to the CreateDir, GetCurrentDir, RemoveDir, and SetCurrentDir functions. This string is empty if FileName contains no drive and directory parts. |
SysUtils | ||||||||||||||||||||||||
| ExtractFileDrive | function
ExtractFileDrive(const FileName: string): string; ExtractFileDrive returns a string containing the drive portion of a fully qualified path name for the file passed in the FileName. For file names with drive letters, the result is in the form '<drive>'. For file names with a UNC path the result is in the form '\\<servername>\<sharename>'. If the given path contains neither style of path prefix, the result is an empty string. |
SysUtils | ||||||||||||||||||||||||
| ExtractFileExt | function ExtractFileExt(const
FileName: string): string; Use ExtractFileExt to obtain the extension from a file name. The resulting string includes the period character that separates the name and extension parts. This string is empty if the given file name has no extension.
|
SysUtils | ||||||||||||||||||||||||
| ExtractFileName | function ExtractFileName(const
Filename: string): string; Extracts the name and extension parts of the given filename. |
SysUtils | ||||||||||||||||||||||||
| ExtractFilePath | function
ExtractFilePath(const FileName: string): string; The resulting string is the rightmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts. |
SysUtils | ||||||||||||||||||||||||
| ExtractRelativePath | function
ExtractRelativePath(const BaseName, DestName: string): string; Call ExtractRelativePath to convert a fully qualified path name into a relative path name. The DestName parameter specifies file name (including path) to be converted. BaseName is the fully qualified name of the base directory to which the returned path name should be relative. |
SysUtils | ||||||||||||||||||||||||
| ExtractShortPathName | function ExtractShortPathName(const
FileName: string): string; ExtractShortPathName converts the file name, FileName,
to the short 8.3 form. ExtractShortPathName returns an empty string if the file
or directory does not exist. |
SysUtils | ||||||||||||||||||||||||
| FILE | FILE of Byte: See FileSize example (below) | reserved keyword | ||||||||||||||||||||||||
| Peter Below's UseNet Post including
RegisterFiletype procedure Ulli Conrad's UseNet Post Add two keys to the registry ATShell is a Delphi 2/3 component for managing file associations. It has the
following features: Create association, Remove association, Set association, shell
extensions (right click menu) + many more. A Windows 98 File Association Un-Mangler. Dave Jewell begins work on a Windows file association un-mangler, teaching us a lot about the ins and outs of the registry along the way. Plus, he outlines what there is (or isnt) for programmers to get excited about in Windows 98... Delphi Magazine, Issue 36, August 98 Windows 98 File Associations, Part 2. Dave Jewell concludes the construction of his Windows file association un-mangler, so now you can happily undo the damage wreaked by a certain well-known software manufacturer... Delphi Magazine, Issue 37, Sept 98 |
||||||||||||||||||||||||||
| SysUtils Unit: faReadOnly = $00000001; faHidden = $00000002; faSysFile = $00000004; faVolumeID = $00000008; faDirectory = $00000010; faArchive = $00000020; faAnyFile = $0000003F; Function HasAttr is in the FMXUtils.PAS unit of Neil Rubenking's update to PC Magazine utility WMatch32,18 March 1999, which compare directories side-by-side |
||||||||||||||||||||||||||
| File Date and Time |
See AlterFileTimeStamp.TXT example. See efg's Dates and Times page Section: File Date and Time How to Match File Date/Time, Borland TI 719D |
|||||||||||||||||||||||||
| File Extensions | Registering a file extension and context menu operations Borland FAQ 2430D Delphi in a Nutshell, "Forms and Files," p. 2-3 File Extensions Delphi File Extensions |
|||||||||||||||||||||||||
| File Locking | Philippe Ranger's UseNet Post with File Locking Example | |||||||||||||||||||||||||
| File Management | Delphi in a
Nutshell, "File Managment," pp. 494-503 - File Input and Output - Managing Files - Managing Directories - Managing Disks - Managing Filenames |
|||||||||||||||||||||||||
| File Mapping | efg's UseNet Post with a method used by Neil Rubenking in one of his Delphi PC Magazine utilities to prevent a second instance of an application. Neil's method uses CreateFileMapping, OpenFIleMapping, MapViewOfFile, UnMapViewOfFile | |||||||||||||||||||||||||
| File Notification | File Notification: VB or Delphi: Which Does COM Automation Best?, Delphi Informant, April 1998. |
|||||||||||||||||||||||||
| File Properties | Peter Below's UseNet Post "File Properties" | |||||||||||||||||||||||||
| File Variable | How can I assign a file variable in a Record, FAQ 1097D | |||||||||||||||||||||||||
| FileAge | D1: function FileAge(const Filename: string): LongInt; D2-D4: Returns the age of the file or -1 if the file does not exist. Look for example on efg's Dates and Times page |
SysUtils | ||||||||||||||||||||||||
| FileDateToDateTime | s := FormatDateTime('mm/dd/yyy
hh:nn:ss', // see TSearchRec below FileDateToDateTime(SearchRec.Time) ); See EXE Date example above Borland TI 541D |
SysUtils | ||||||||||||||||||||||||
| FileExists | function FileExits(const Filename:
string): Boolean; Returns TRUE if specified file exists. FileExists Using IOResult: UseNet Post by Sean Kendrick See example under Append in File I/O |
SysUtils | ||||||||||||||||||||||||
| FileGetAttr | function FileGetAttr(const FileName:
string): Integer; FileGetAttr returns the attributes of the file as
a string of bits. This value is the same as the Attr field of a TSearchRec
record. Check for individual attributes with code such as the following: Garth S. Wilcox's UseNet Post with example of removing read-only attribute. |
SysUtils | ||||||||||||||||||||||||
| FileGetDate | function FileGetDate(Handle:
Integer): Integer; Use FileGetDate to determine the timestamp of a file given its handle. The return value is -1 if the handle is invalid. The FileDateToDateTime function can be used to convert the returned value to a TDateTime value. Borland TI 541D |
|||||||||||||||||||||||||
| FileMapping | See examples of OpenFileMapping, CreateFileMapping, and UnMapViewOfFile in RegDet.DPR file in Neil Rubenking's Registry Detective utility from PC Magazine | |||||||||||||||||||||||||
| FileMode variable | var FileMode: Byte; The FileMode
variable determines the access mode to use when typed and untyped files (not text
files) are opened using the Reset procedure. |
System | ||||||||||||||||||||||||
| FileSearch | function FileSearch(const
Name, DirList: string): string; FileSearch searches through the directories passed in DirList for a file named Name. DirList is a semicolon delimited set of DOS path names. If FileSearch locates a file matching Name, it returns a string specifying a fully-qualified path name for that file. If no matching file exists, FileSearch returns an empty string. see also FindFirst/FindNext/FindClose in Directories |
SysUtils | ||||||||||||||||||||||||
| FileSetAttr | function
FileSetAttr(const FileName: string; Attr: Integer): Integer; FileSetAttr
sets the file attributes of the file given by FileName to the value given by Attr. The
value of Attr is formed by combining the appropriate file attribute constants, as in the
following: Garth S. Wilcox's UseNet Post with example of removing read-only attribute. Recursive delete a group of files and subdirectories |
SysUtils | ||||||||||||||||||||||||
| FileSetDate | function FileSetDate(Handle:
Integer; Age: Integer): Integer; FileSetDate sets the DOS date-time stamp of the file given by Handle to the value given by Age. The DateTimeToFileDate function can be used to convert a TDateTime value to a DOS date-time stamp. The return value is zero if the function was successful. Otherwise the return value is a Windows error code. How to Match File Date/Time, Borland TI 719D |
SysUtils | ||||||||||||||||||||||||
| Neil Rubenking's FileSizeFromName
in the AllFuncs.pas unit of his ColorClue
utility.
|
System | |||||||||||||||||||||||||
| Opening the "Find Files..." Dialog Using Delphi by Eddie Shipman www.undu.com/Articles/980226a.htm Eddie Shipman's UseNet Post to use Find Files or Folders Dialog From
the Shell: Dialog Boxes You've Always Needed, Delphi Informant, May
1999 |
||||||||||||||||||||||||||
| GetFileDate | function FileGetDate(Handle:
Integer): Integer; Use FileGetDate to determine the timestamp of a file given its handle. The return value is -1 if the handle is invalid. The FileDateToDateTime function can be used to convert the returned value to a TDateTime value. Borland TI 541D |
|||||||||||||||||||||||||
| GetFileLastAccessTime | When was that file last accessed? www.chami.com/tips/delphi/012797D.html |
|||||||||||||||||||||||||
| GetFileSize |
GetFileSize using FindFirst in UseNet Post by Freter |
|||||||||||||||||||||||||
| GetFileVersionInfo | Steve Shafer's GetBuildInfo procedure in
UseNet Post by Peter
Below. (works in D4 or D5 but gives access violation in D3) |
|||||||||||||||||||||||||
| GetTempFilename |
When was that file last accessed? |
|||||||||||||||||||||||||
| GpHugeFile | Encapsulation of Windows file-handling routines that allows
work with >2GB files. www.eccentrica.org/gabr/gp/index.htm#THugeFile |
|||||||||||||||||||||||||
| Handle | Getting a handle on your files, FAQ 534D | |||||||||||||||||||||||||
| IncludeTrailingBackSlash (D5) |
SysUtils | |||||||||||||||||||||||||
| .INI files appear to have a 64 KB limit
(removed when using TMemIniFile instead of TIniFile) and 1023 bytes per
character string.
|
TIniFile in IniFiles |
|||||||||||||||||||||||||
Example:
|
||||||||||||||||||||||||||
| Peter Below's comments about TMemIniFile in UseNet Post: "Internally TMemInifile is just a TStringlist. Each access to a section or item involves linear searches through the stringlist lines, so it tends to get slow if you have thousands of lines. For very large inifiles a better in-memory representation would be a TList of TStringlists, one for each section." | ||||||||||||||||||||||||||
| Peter Below's UseNet Post about changing default printer in D6 including a SendMessage of a WM_WININICHANGE message. | ||||||||||||||||||||||||||
| IsFileInUse | www.bhnet.com.br/~simonet/tipstricks/fileinuse.htm | |||||||||||||||||||||||||
| IsLocalFile | Thomas Nelvik's UseNet Post with sample code | |||||||||||||||||||||||||
| JEDI | Delphi Jedi Code Library, JclFileUtils.PAS unit | |||||||||||||||||||||||||
| Links | MakeALink and ReadALink functions in the AllFuncs.pas unit of Neil Rubenking's ColorClue utility. | |||||||||||||||||||||||||
| Long FileNames | Using Windows 95 long filenames in command-line parameters www.zdjournals.com/ddj/9608/ddj9681.htm |
|||||||||||||||||||||||||
| LZCopy | - How to copy files in Delphi, Borland TI 910D | |||||||||||||||||||||||||
| Managing Filenames | Delphi in a Nutshell, pp. 501-503 | |||||||||||||||||||||||||
| Managing Files | Delphi in a Nutshell, pp. 497-499 | |||||||||||||||||||||||||
| MatchesMask | function MatchesMask(const
Filename, Mask: string): Boolean; Call MatchesMask to check the
Filename parameter using the Mask parameter to describe valid values. A valid mask
consists of literal characters, sets, and wildcards. Note: The Filename parameter does not need to be a file name. MatchesMask can be used to check strings against any syntactically correct mask. |
Masks | ||||||||||||||||||||||||
| "Using Memory-Mapped Files" Delphi 5
Developer's Guide (pp. 362-379) by Teixeria and Pacheco
In Chapter 14 of Mastering Delphi 5 (pp. 675-677), Marco Cantů explains "Sharing Data with Memory-Mapped Files." Memory Mapped Files -- Client Memory Mapped Files -- Server Patrick Martin's example TBitmap descendant using memory mapped files |
||||||||||||||||||||||||||
| MinimizeName | function MinimizeName(const Filename: TFileName; Canvas: TCanvas; MaxLen: Integer): TFileName; | FileCtrl | ||||||||||||||||||||||||
| New EXE File Header | New EXE Headers http://atlas.csd.net/~cgadd/knowbase/WIN-OS20025.HTM Neil Rubenking's TNEHeader Record in his PC Magazine FindOrphans utility, 6 June 2000. |
|||||||||||||||||||||||||
| OpenWith dialog | Example of calling OpenWith dialog to open a specified file with a selected program. OpenWithExample.TXT | |||||||||||||||||||||||||
| Orphaned Files | Find and Remove Orphaned Files PC Magazine Utility FindOrphans by Neil Rubenking |
|||||||||||||||||||||||||
| ParamStr(0) | Path and name of the EXE. Same as Application.EXEname. See |
System | ||||||||||||||||||||||||
| Path Manipulation | function
PathAddSeparator(const Path: string): string; function PathAddExtension(const Path, Extension: string): string; function PathAppend(const Path, Append: string): string; function PathBuildRoot(const Drive: Byte): string; function PathCommonPrefix(const Path1, Path2: string): Integer; function PathCompactPath(const DC: HDC; const Path: string; const Width: Integer; CmpFmt: Boolean {$IFDEF SUPPORTS_DEFAULTPARAMS} = True {$ENDIF}): string; procedure PathExtractElements(const P: string; var Drive, Path, FileName, Ext: string); function PathExtractFileNameNoExt(const Path: string): string; function PathGetLongName(const Path: string): string; function PathGetShortName(const Path: string): string; function PathIsAbsolute(const Path: string): Boolean; function PathIsDiskDevice(const Path: string): Boolean; function PathIsUNC(const Path: string): Boolean; function PathRemoveSeparator(const Path: string): string; function PathRemoveExtension(const Path: string): string Delphi Jedi Code Library (JCL), JCLFileUtils.PAS unit |
|||||||||||||||||||||||||
| ProcessPath | procedure ProcessPath (const
EditText: string; var Drive: Char; var DirPart: string; var FilePart: string); Call ProcessPath to parse a file name into its drive, path, and file name. Pass the full file name that should be parsed as the EditText parameter. ProcessPath returns the indicated drive, directory, and file name as the Drive, DirPart, and FilePart parameters. |
FileCtrl | ||||||||||||||||||||||||
| Read-Only Files | For Reset, set the FileMode to 0. For example: AssignFile(F, Filename); |
|||||||||||||||||||||||||
| Also see SHFileOperation.
Neil Rubenking's RecycleFile in the AllFuncs.pas unit of his ColorClue utility. Daniel U. Thibault's DUTUtilsTrash Unit that contains standalone "Trash" (Recycle Bin) utilities, including GetTrashContents, RestoreFromTrash, and EmptyTrash. Now works under WinNT as well as Win95. The zip also includes a very simple demo applet. Sending Files to the Recycle Bin (link broken 3 March 2000) Bernd Ua's UseNet
Post about "How to empty recycle bin?" UseNet Thread about quoting Steve Schafer about Recycle Bin Internals MS Q136517
"How the Recycle Bin Stores Files" |
||||||||||||||||||||||||||
| Registry | Complete Delphi source code can be found with
these PC Magazine utilities by Neil Rubenking:
See examples of reading registry keys under FileDateToDateTime examples |
|||||||||||||||||||||||||
| RenameFile | function RenameFile(const
OldName, NewName: string): Boolean; Renames the specified file or directory. Wrapper around MoveFile API call. |
SysUtils | ||||||||||||||||||||||||
| ScanFile | Peter Below's UseNet Post about how to search file for a specified text | |||||||||||||||||||||||||
| Sharing | Peter Below's UseNet Post about sharing files on a network | |||||||||||||||||||||||||
| ShellAPI | Extra Shell Folder locations interface.
Project JEDI Conversion Library by Rudolph Velthuis. ftp://delphi-jedi.org/api/ShFolder.zip A complement to Delphi 3.02's ShellAPI.pas (Explorer). Project
JEDI Conversion Library by Daniel U. Thibault. A complement to Delphi 3.02's ShlObj.pas (Explorer). Project JEDI
Conversion Library by Daniel U. Thibault. |
|||||||||||||||||||||||||
| ShellExecuteEx | Peter Below's UseNet Post "File Properties" | |||||||||||||||||||||||||
| SHEmptyRecycleBin | Xavier Pacheco's (Team B) UseNet
Post about "How to delete the information in the recycle
bin"
Bernd Ua's UseNet Post about "How to empty recycle bin?" |
|||||||||||||||||||||||||
| Also see Recycle Bin.
Charles Hacker's UseNet Post with SHFileOperation example to copy network drive to local drive "Using the SHFileOperation Function," Delphi 5 Developer's Guide (pp. 404-406) by Teixeria and Pacheco (Worked in Windows 98/2000, but failed in original Win 95 -- I likley need an updated Shell32.DLL.) According to Johannes Berg in a UseNet post, you have to give SHFileOperation the fully qualified filename due to a bug (or feature?) of Windows. Peter Below's UseNet
Post with example of how to delete a folder Utilisation de l'API SHFileOperation TFileOperation component performs a copy, move, rename or delete
operation on a file system object along with the folder animations first introduced in
Microsoft Windows 95. It encapsulates the SHFileOperation provided as Shell API in Win32
environment. Drag and Drop with Files, FAQ 529D Probing into the Shell's File Operations (Move/Copy/Delete Files) With this single component, a wrapper around the Windows SHFileOperation API, you can Copy, Rename, Move, Delete, and Recycle any list of files with a single operation. Wayne Niddery's TShellFileOp |
ShellAPI | |||||||||||||||||||||||||
| SHGetFileInfo |
SHGetFielInfoCaches Drive Information |
|||||||||||||||||||||||||
| Shortcuts | A Quick Way to Shortcuts: A Component for
Creating and Modifying Shortcuts www.delphizine.com/features/2000/10/di200010bt_f/di200010bt_f.asp Adding shortcuts to Win95/WinNT4 Desktop/StartMenu In Chapter 15 of Mastering Delphi 5 (pp. 708-710), Marco Cantů explains "Creating Shortcuts." |
|||||||||||||||||||||||||
| "Slice" | "Slice" large files into smaller
pieces, then splice them together again.
Non-Delphi: |
|||||||||||||||||||||||||
| SWAG | Files SWAG (Software Archive Group). 109 various file
examples www.gdsoft.com/swag/files.zip (requires Reader) TextFile SWAG.
81 examples |
|||||||||||||||||||||||||
| TempFileName | Neil Rubenking's TempFileName in the
AllFuncs.pas unit of his ColorClue
utility.
Also see, GetTempFileName. |
|||||||||||||||||||||||||
| Test Files | A test file of known size containing ASCII text is often useful to measure actual transfer rates. The utility "GenTxt" was create for this purpose and can create files up to about 5.9 GB in size (could easily be modified to be even bigger). See Item B-4 on the Other Projects page. | |||||||||||||||||||||||||
| TestFilename | Test if a string is a valid file name www.preview.org/q/q2129.shtml |
|||||||||||||||||||||||||
| TFilename | TYPE TFileName: STRING[79]; // D1 TFileName = STRING; // D2-D3 TFilename = TYPE STRING; // D4, D5 (stronger typing) |
SysUtils | ||||||||||||||||||||||||
| TFindFilesDialog | TFindFilesDialog and TFindComputerDialog are component
wrappers for two undocumented Windows API functions. The first displays the
standard Find Files dialog and the second the Find Computer dialog. http://delphi.icm.edu.pl/ftp/d20free/finddlgs.zip |
|||||||||||||||||||||||||
| TIniFile | See INI Files | |||||||||||||||||||||||||
| TOpenDialog | See UseNet Post by Matthijs J. Willemstein with an example | Dialogs | ||||||||||||||||||||||||
| TRegIniFile | Registering a file extension and context menu operations Borland FAQ 2430D |
|||||||||||||||||||||||||
| TSaveDialog | Dialogs | |||||||||||||||||||||||||
See |
SysUtils | |||||||||||||||||||||||||
| Typed Files | My Own Database http://delphi.about.com/library/weekly/aa080100a.htm |
|||||||||||||||||||||||||
| TWin32FindData | See TSearchRec
When was that file last accessed? Using FindFirst and the WIN_32_FIND_DATA structure, Borland TI 1512D |
Windows | ||||||||||||||||||||||||
| UNIX text files only have LFs (line feeds), not CRs (carriage
returns). LF = #10 = #$0A CR = #13 = #$0D UNIX DateTime to Delphi DateTime Deepak Shenoy's UseNet Post with file stream example of converting UNIX text to DOS text Mike (TeamB) UseNet Post about parsing UNIX files Use AdjustLineBreaks to "fix" line ends. Read the whole file as one string using TFileStream, call AdjustLineBreaks and then save in the converted file. |
||||||||||||||||||||||||||
| Waiting for Files | Antonio's UseNet Post with "efficient" way to wait for a file (FindFirstChangeNotification, FindNextChangeNotification, FindCloseChangeNotification | |||||||||||||||||||||||||
| WM_DROPFILES | Drag and Drop with Files, FAQ 529D | |||||||||||||||||||||||||
| Working with Files |
"Working with Files," Delphi 5 Developer's Guide, Chapter 12, by Teixeria and Pacheco |
|||||||||||||||||||||||||
| Zero-length file | Here's a trick way to create a zero-length file with a
single statement: TFileStream.Create(ExtractFilePath(ParamStr(0)) + 'ZeroLength.DAT', fmCreate).Destroy; |
|||||||||||||||||||||||||
| Zipped Files | InZip performs much the same function as the Windows Find
facility, but instead finds files matching your search criteria inside Zip
files. If you zip files and can't remember in which zip file they are you
will find InZip indispensable. www.btinternet.com/~alfowler/IZ1.htm |
Updated
27 Aug 2005
since
19 Apr 1999