bugGNUstep - Bugs: bug #36726, dataWithContentsOfURL: and...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36726: dataWithContentsOfURL: and file-URLs - method returns nil once the file has been modified

Submitted by:  Michael Johnston <mjohnston>
Submitted on:  Mon 25 Jun 2012 02:26:07 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: In Test

Sun 08 Jul 2012 12:03:51 PM UTC, comment #1:

Thanks ... hopefully this is fixed in svn trunk now.

Richard Frith-Macdonald <CaS>
Project Member
Mon 25 Jun 2012 02:26:07 PM UTC, original submission:

I've seen the following problem in base version 1.22 and 1.24 but don't know if it was present before-hand.

The first time you use dataWithContentsOfURL: to read the contents of a file-url it caches a GSFileURLHandle instance with the data.

On subsequent calls the GSFileURLHandle instance is retrieved from the cache (via [NSURL resourceDataUsingCache:]) and the data obtained by calling availableResourceData on it.

However if the file has been modified between two calls [GSFileURLHandle availableResourceData] destroys its contents and returns nil. So you can no longer obtain the files contents using dataWithContentsOfURL:.

From apple docs availableResourceData should only return nil if the data could not be loaded (although this class has been deprecated). Is there some reason the handle does not reload the data when it detects the modification?

In any case, from the docs dataWithContentsOfURL: should always return the urls-contents if it is accessible.

Michael Johnston <mjohnston>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by FredKiefer (Updated the item)
  • -unavailable- added by mjohnston (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Jul 2012 12:03:51 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Sat 30 Jun 2012 05:57:26 PM UTCFredKieferItem GroupNone=>Bug
    Sat 30 Jun 2012 05:57:25 PM UTCFredKieferCategoryNone=>Base/Foundation

    Back to the top


    Powered by Savane 3.1-cleanup1