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 7029933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:13+00:00 2026-05-28T00:36:13+00:00

For an iPhone Firemonkey application I am storing files (images) in the ‘tmp’ folder

  • 0

For an iPhone Firemonkey application I am storing files (images) in the ‘tmp’ folder and using them in my application. I want to be able flush the cache by deleting say all of the ‘.jpg’ files on demand, but I cannot seem to programatically match them in a FindFirst() call.

I am using a simple FindFirst() / FindNext() / FindClose() loop to list (and delete) the contents of a folder.

Under windows the code works perfectly. The same application under iOS (iPhone) is always returning a value of -1 (error) for the FindFirst() call, and SearchRec.Name is blank. I have tried using various file patterns including ‘.‘ with no success.

I know the files exist because I can read and write to them (under both iOS and windows) without error, and their contents is correct. A FileExists() check also returns True.

Also, if I specify a file pattern with no wildcard, to check for a known file (which really isn’t the point of a FindFirst() call), the call never returns (again this is fine under windows)!

Has anyone had any success with this under iOS and can offer any thoughts?

Thanks,

EDIT: Code snippet as requested which demonstrates the problem.
Note: _sFolderName contains the cache folder name which I have confirmed is definitely correct.

function GetCacheFileList : string;
var
  iResult: integer;
  sr: TSearchRec;
  sPath,
  sTemp: string;
  sFilename : TFilename;
begin
  sTemp     := '';
  sFilename := _sFolderName + '*.jpg';
  //
  iResult := FindFirst(sFilename, faAnyFile, sr);  // ALWAYS RETURNS -1 under iOS
  while (iResult = 0) do
  begin
    sTemp := sTemp + sr.Name + sLineBreak;
    iResult := FindNext(sr)
  end; { while }
  //
  FindClose(sr);
  Result := sTemp
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. Editorial Team
    Editorial Team
    2026-05-28T00:36:13+00:00Added an answer on May 28, 2026 at 12:36 am

    This has been fixed under XE2 update 3

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

Sidebar

Related Questions

I have a Delphi XE2 Firemonkey application that I want to run on both
I am trying to write an iPhone app using Delphi XE2 / FireMonkey and
iPhone application, which has two buttons -right side- of Navigation Bar title. I want
Dear iPhone Developers, I am writing a Navigation based iPhone application. I want to
In iPhone application I want to generate a image of UIScrollView whose content size
my iphone app is using soap web-services. I want to know how it would
My iPhone application is based on remote desktop protocol which communcates with PC using
For iPhone game development, seems there are very like functions using CALayer and UIView,
My iPhone application screen looks like this: When i reverse my iPhone 45 degree,
How do I access the iphone compass in Firemonkey?

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.