Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 162699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:26:15+00:00 2026-05-11T11:26:15+00:00

I have to make a unix compatible windows delphi routine that confirms if a

  • 0

I have to make a unix compatible windows delphi routine that confirms if a file name exists in filesystem exactly in same CaSe as wanted, e.g. ‘John.txt’ is there, not ‘john.txt’.

If I check ‘FileExists(‘john.txt’)’ its always true for John.txt and JOHN.TXT due windows .

How can I create ‘FileExistsCaseSensitive(myfile)’ function to confirm a file is really what its supposed to be.

DELPHI Sysutils.FileExists uses the following function to see if file is there, how to change it to double check file name is on file system is lowercase and exists:

function FileAge(const FileName: string): Integer; var   Handle: THandle;   FindData: TWin32FindData;   LocalFileTime: TFileTime; begin   Handle := FindFirstFile(PChar(FileName), FindData);   if Handle <> INVALID_HANDLE_VALUE then   begin     Windows.FindClose(Handle);     if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then     begin       FileTimeToLocalFileTime(FindData.ftLastWriteTime, LocalFileTime);       if FileTimeToDosDateTime(LocalFileTime, LongRec(Result).Hi,         LongRec(Result).Lo) then Exit;     end;   end;   Result := -1; end; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:26:16+00:00Added an answer on May 11, 2026 at 11:26 am
    function FileExistsEx(const FileName: string): Integer; var   Handle: THandle;   FindData: TWin32FindData;   LocalFileTime: TFileTime; begin   Handle := FindFirstFile(PChar(FileName), FindData);   if Handle <> INVALID_HANDLE_VALUE then   begin     Windows.FindClose(Handle);     if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then     begin       FileTimeToLocalFileTime(FindData.ftLastWriteTime, LocalFileTime);       if FileTimeToDosDateTime(LocalFileTime, LongRec(Result).Hi, LongRec(Result).Lo) then         if AnsiSameStr(FindData.cFileName, ExtractFileName(FileName)) then Exit;     end;   end;   Result := -1; end; 

    Tom, I’m also intrigued by your use case. I tend to agree with Motti that it would be counter intuitive and might strike your users as odd.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make a schema for an XML format that's already being used.
When working in the unmanaged world, we have to make sure that we clean
I have to make column charts in Excel using VBA only (no user input).
I have a control which I have to make large modifications to. I'd like
For my university assignment I have to make a networkable version of pacman. I
In our application we sometimes have to make minor GUI modifications for different customers:
I'm working on an application where users have to make a call and type
I'm busy with an asignment where i have to make a graphical interface for
In a WPF UserControl, I have to make to call to a WebService. I
I know I'm gonna get down votes, but I have to make sure if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.