Extractfiledir and extractfilepath
Extractfiledir get the folder name from the file name (the value obtained when the file is not in the root folder does not have "/", and it is a drive letter, such as "C :/")
Extractfilepath: Get the path name from the file name. (If the file is not in the root folder, the obtained value is "/". If the file is in the root folder, It is a drive letter, for example, "C :/")
Function declaration:
Function extractfiledir (const filename: string): string;
Function extractfilepath (const filename: string): string;
You can put the following statement into the program and view the result:
Showmessage (extractfiledir ('C:/Borland/Delphi/test.exe '));
Execution result:
Showmessage (extractfilepath ('C:/Borland/Delphi/test.exe '));
Execution result:
Showmessage (extractfiledir ('C:/test.exe '));
Execution result:
Showmessage (extractfilepath ('C:/test.exe '));
Execution result:
Extractfiledir and extractfilepath