From: "Thomas Nelvik" Newsgroups: borland.public.delphi.winapi References: <3b1c0442$1_1@dnews> Subject: Re: IsLocalFile? Date: Tue, 5 Jun 2001 00:14:35 +0200 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 NNTP-Posting-Host: 62.179.170.108 Message-ID: <3b1c07c7_1@dnews> X-Trace: dnews 991692743 62.179.170.108 (4 Jun 2001 15:12:23 -0700) Path: dnews Xref: dnews borland.public.delphi.winapi:137198 Mike C wrote: > Anybody know a way to determine whether a file/directory is local or on the > network? > I would like to optimize a file move routine so that it simply renames the > target file if it is local. As compared to copying from the network. I guess something like this should do it... {--------------------} {uses Windows, SysUtils, etc } function IsLocalFile(const aFilename: string): Boolean; var D: string; begin D := ExtractFileDrive(aFilename) + '\'; Result := GetDriveType(PCHAR(D)) <> DRIVE_REMOTE; end; {--------------------} -ThomasN