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

  • Home
  • SEARCH
  • 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 3288474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:36:42+00:00 2026-05-17T20:36:42+00:00

I have a file open on the iPhone that I am sending the data

  • 0

I have a file open on the iPhone that I am sending the data of across the network (Opened using “_open”). However I have the ability to delete files from the iphone’s interface. This is done using NSFileManager’s removeItemAtPath.

The odd thing is that removeItemAtPath is succeeding even though the file is currently open.

The file transfers perfectly across the network and removeItemAtPath succeeds before the transfer is complete. So does removeItemAtPath do a lazy delete? ie does it queue it for later if the file is in use? If so then no problems.

If not … does anyone know how I can get NSFileManager to actually report the fact that it didn’t do the delete?

Thanks!

  • 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-17T20:36:43+00:00Added an answer on May 17, 2026 at 8:36 pm

    According to the documentation at

    http://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/fileManager:shouldRemoveItemAtPath:

    shouldRemoveItemAtPath returns YES if the operation should proceed, not necessarily that it already successfully deleted the item. It’s also interesting that the documentation states:

    Discussion Returning NO from this method causes NSFileManager to stop deleting the item. If the item is a directory, no children of that item are deleted either.

    Reading that leads me to believe this is an asynchronous operation and that the return value of this method should not be used to determine if the file was successfully deleted. My guess is that it queues the object for deletion and will be deleted when the file is no longer in use.

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

Sidebar

Related Questions

I have a program that roughly does this: open a file to read from
I have the following code: f = File.open(/log/mytext.txt) f.each_line do |i| i = i.delete(\n)
Suppose I have an open file. How can I detect when the file is
I have: <?php $file=fopen(date(Y-m-d)..txt,r+) or exit(Unable to open file!); if ($_POST[lastname] <> ) {
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)
In php I have open a .php file and want to evaluate certain lines.
I have a FAT12 image file and I have to open it and read
I want to open a save file dialog, have the user enter a filename,
In the filesystem I have /file.aspx /directory/default.aspx I want to configure IIS so that
I have a file in the following format: Data Data Data [Start] Data I

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.