title: Finding file's size
body: <p>In my iPhone app I am using the following code to find a file's size. Even though the file exists, I am seeing zero for the size. Can anyone help me? Thanks in advance.</p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *documentsDirectory = [paths objectAtIndex:0];
  NSString *URL = [documentsDirectory stringByAppendingPathComponent:@"XML/Extras/Approval.xml"];
  
  NSLog(@"URL:%@",URL);
  NSError *attributesError = nil;
  NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:URL error:&amp;attributesError];
  
  int fileSize = [fileAttributes fileSize];
  </code></pre>