bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #36726] dataWithContentsOfURL: and file-URLs - method returns nil o


From: Michael Johnston
Subject: [bug #36726] dataWithContentsOfURL: and file-URLs - method returns nil once the file has been modified
Date: Mon, 25 Jun 2012 14:26:08 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/11.04 Chromium/18.0.1025.151 Chrome/18.0.1025.151 Safari/535.19

URL:
  <http://savannah.gnu.org/bugs/?36726>

                 Summary: dataWithContentsOfURL: and file-URLs - method
returns nil once the file has been modified
                 Project: GNUstep
            Submitted by: mjohnston
            Submitted on: Mon 25 Jun 2012 02:26:07 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36726>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]