Trouver taille du fichier

Dans mon iPhone, j'utilise le code suivant pour rechercher un fichier de taille. Même si le fichier existe, je vois zéro pour la taille. Quelqu'un peut-il m'aider? Merci à l'avance.

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:&attributesError];

int fileSize = [fileAttributes fileSize];
  • Bizarre, avec votre code, je peux obtenir la taille correctement, quel était le problème?
InformationsquelleAutor Kiran | 2011-04-21