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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:34:39+00:00 2026-05-13T07:34:39+00:00

Short version: I think I’m asking for a file too soon, but it’s pretending

  • 0

Short version: I think I’m asking for a file too soon, but it’s pretending like it’s ready. Am I missing something?

Slightly longer version: I am writing files to disk. Before I do so, I have the user add some meta data, including the new file name. Once the user is done, the screen goes away and the program writes the file to disk. The user can then look at a list of files. That list is generated by reading the contents of a folder. The new file is in the list of files, but when I try to extract info from the file to display (e.g. file size) the program crashes. As best as I can tell, the crash occurs because, while the file is there in name, it’s not available to be read. (By the way, these are small files – a few hundred k.)

First, is it possible that a file shows up in the directory but isn’t all there yet?
a
And second, if so, how do I check to see if the file is ready to be read?

Thanks much.

UPDATE:

Thanks. I’ll try to add more info. I’m recording an audio file with AVAudioRecorder. The init line is:

soundrecording = [[AVAudioRecorder alloc] initWithURL:url settings:recordSettings error:&error];

The program goes through it’s UI updates and metering and all that. When the audio is stopped, I call:

[soundrecording stop];

and when everything else is updated and ready to move on, I call:

[soundrecording release];
soundrecording=NULL;

As far as I understand, this should take care of releasing the file, yes?

Thanks again.

  • 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-13T07:34:40+00:00Added an answer on May 13, 2026 at 7:34 am

    Now that you have added sample code, I can say some more.

    First, the class reference seems to say that the stop method will close the file. However it also seems to suggest that there is an underlying audio session going on, and possibly some conversion. I think I recall that the iPhone’s Voice Notes app, which probably uses this API, has to do some work to compress a long recording after it’s completed.

    So I support your hunch. I think that your file may not be closed yet, but on another thread that is processing the recorded data into a proper format to save.

    You probably want to set a NSTimer to attempt to open the file every second or so, so that your user interface can perk up when it’s done. You probably want to show a “Please wait” sort of message in the meantime, or otherwise let the user know it’s working.

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

Sidebar

Related Questions

Short version: I want to trigger the Form_Load() event without making the form visible.
Short version: I'm wondering if it's possible, and how best, to utilise CPU specific
Short version: assuming I don't want to keep the data for long, how do
Short Version: When I've created a Channel using ChannelFactory on a client which uses
I am writing an application to manage user access to files. The short version
Short of putting a UIWebView as the back-most layer in my nib file, how
Short Version : I'm using a 64bit dll (system.data.sqlite) in an Asp.net MVC app
Short version: When I try to use Access's DatePart function via ODBC, it cannot
Short version: The default inspect method for a class displays the object's address.* How
I apologize for the title, but I couldn't think of a better way to

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.