Library functions for file operations provided by BCB

Source: Internet
Author: User

A function of file manipulation is also provided in BCB, the functions of these functions are roughly the same as those described earlier, but these functions are closely related to BCB and can use data types such as the ansistring in BCB, which is the most convenient way to file operations in BCB, and I'll introduce this file operation in detail below.

In the BCB provided by this set of file operation functions, can be divided into three types, namely: 1, File name functions, 2, File management functions, 3, file I/O functions.

1. File name function

The filename function can operate on the name of the file, the subdirectory, the drive, and the extension. The following table lists these functions and their functions.

Function description

Expandfilename () returns the full path of the file (including drive, path)

Extractfileext () Extract the extension from the file name

Extractfilename () Extract filename without path from file name

Extractfilepath () Extract path name from file name

Extractfiledir () Extract the directory name from the file name

Extractfiledrive () Extract the drive name from the file name

Changefileext () Change the file name extension

Expanduncfilename () returns the full path to the file containing the network drive

Extractrelativepath () Extract relative path information from the file name

Extractshortpathname () Converts the file name to DOS 8 3 format

Matchesmask () checks whether the file matches the specified file name format

Here's a description of these functions:

⑴expandfilename ()

Prototype: extern PACKAGE ansistring __fastcall expandfilename (const ansistring FileName);

Function: Returns the full path of the file (including drive, path)

Parameters: FileName: filename to be processed

Example: ShowMessage (Expandfilename (Application->exename));//Display your program file name, such as C:\MyBCB\Sample1.EXE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.