---
title: "获取本地文件字节数"
author: "刺骨的夜"
date: "2015-04-30T12:35:03Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2015-04-30T12:35:03Z"
id: 2207581
url: "https://lanxs.iteye.com/blog/2207581"
---

//获取本地文件字节数

-(long long) fileSizeAtPath:(NSString\*) filePath{

    NSFileManager* manager = \[NSFileManagerdefaultManager];

    if (\[manager fileExistsAtPath:filePath]){

        return \[\[manager attributesOfItemAtPath:filePath error:nil] fileSize];

    }

    return 0;

 

}