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

Group
 
 

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

Submitter:  Michael Johnston <mjohnston>
Submitted:  Mon 25 Jun 2012 02:26:07 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

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

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

Richard Frith-Macdonald <CaS>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-08 CaS StatusNone Fixed
        Open/ClosedOpen In Test
    2012-06-30 FredKiefer Item GroupNone Bug
    2012-06-30 FredKiefer CategoryNone Base/Foundation

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code