filehelp.h// yufilehelp//// created by yuzhx on 15/ 8/2.// copyright (c) 2015 year bruceyu. all rights reserved.//#import <Foundation/Foundation.h> @interface FileHelp : NSObjecttypedef void (^ Fileobjectblock) (nsstring* m_filepath,bool statuscode);/** * file name modification (default in Zkfilepath file operation) * * @param resourceFileName Original file name * * @param name New file name * * @return (BOOL) **/+ (nsstring*) Modifyfilename: (nsstring*) Resourcefilename newfilename: (nsstring*) name;/** * get the size of a single file * * @param Path to the filepath file * * @return return file size **/+ (Long long) filesizeatpath: ( nsstring*) filePath;/** * Traverse folder to get the folder size, * * @param filepath Path to the folder * * @return Returns the folder size (how many m) */+ (float ) foldersizeatpath: (nsstring*) folderPath;/** * Read all the file paths in Files * * @return Return all file attributes dic **/+ (nsmutablearray*) getfilepathindocumentsdir;/** * Create a directory to save files to documents * * @param directories Folder name * * @return Return folder path created successfully **/+ (nsstring*) Createfiledirectories: ( nsstring*) directories;/** * Create the directory where you want to save the file to TMP * * @param Directories folder name * * @return Return to the folder path for successful creation **/+ (nsstring*) createtempdirectories: (nsstring*) directories;/** * Delete sandbox files or folders * * @param FilePath file paths that need to be deleted * * @return Return operation result (BOOL) **/+ (BOOL) removeItemAtPath: (nsstring*) FilePath; @end
Https://github.com/6357/YUFileHelp
Shared iOS sandbox file management