On 2008-04-21, Aaron Gray <ang.usenet@[EMAIL PROTECTED]
> wrote:
> Has anyone got a code snippet to separate out the path components, ie
drive,
> path, filename, and extension ?
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/sysutils/fina.inc?view=co
Some of the sets and constants are OS specific, here typical unix values:
LineEnding = #10;
LFNSup****t = true;
DirectorySeparator = '/';
DriveSeparator = '/';
ExtensionSeparator = '.';
PathSeparator = ':';
AllowDirectorySeparators : set of char = ['\','/'];
AllowDriveSeparators : set of char = [];
{ FileNameCaseSensitive is defined below! }
maxExitCode = 255;
{$ifdef LINUX}
MaxPathLen = 4096; // linux has always got to be BIGGER
{$else}
MaxPathLen = 1024; // BSDs since 1993, Solaris 10, Darwin
{$endif}
AllFilesMask = '*';
const
UnusedHandle = -1;
StdInputHandle = 0;
StdOutputHandle = 1;
StdErrorHandle = 2;
FileNameCaseSensitive : boolean = true;
CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
sLineBreak = LineEnding;
DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsLF;


|