Objective-C nsfilemanager

Source: Internet
Author: User

Common nsfilemanager operations

-(Bool) contentsatpath: path // read data from the file specified by a path-(bool) createfileatpath: path contents :( nsdata *) data attributes: ATTR // write data-(bool) removefileatpath: path handler: Handler // delete the file specified by a path-(bool) movepath: from topath: to handler: Handler // rename or move an object. From is the source file, to is the target file-(bool) contentsequalatpath: path1 andpath: path2 // compare the content of the two files is the same-(bool) fileexistsatpath: path // determine whether the file specified by path exists-(bool) isreadablefileatpath: path // determine whether the file specified by path exists and whether to perform read operations-(bool) iswritablefileatpath: path // determine whether the file specified by path exists and whether to perform write operations-(nsdictionary *) fileattributesatpath: path traverselink :( bool) Flag // obtain the attributes of the file specified by path, return a dictionary type-(bool) changefileatributes: ATTR atpath: path // change the attributes of the file specified by path nsfi Lemanager directory operation-(nsstring *) currentdirectorypath // get the current directory-(bool) changecurrentdirectorypath: path // change the current directory-(bool) copypath: From topath: to handler: handler // copy the directory structure-(bool) createdirectoryatpath: path attributes: ATTR // create a new directory-(bool) fileexistsatpath: path isdirectory :( bool *) flag // determine if it is a directory-(nsarray *) directorycontentsatpath: path // list directory content-(nsdirectoryenumerator *) enumeratoratpath: path // enumerate directory content-(bool) removefielp Ath: path handler: Handler // delete an empty directory-(bool) movepath: From topath: to handler: Handler // rename or move a directory-(nsstring *) nsusername // return the current user directory-(nsstring *) nsfullusername // return the complete directory of the current user-(nsstring *) nshomedirectory // return the path of the current user's main directory-(nsstring *) nshomedirectoryforuser :( nsstring *) User // return the user's home directory-(nsstring *) nstemporarydirectory // return the temporary directory that can be used to create temporary files + (nsstring *) pathwithcomponents: components // construct a path-(nsarray *) PA based on the value in components Thcomponents // extract the sub-path, obtain each part, and put it into the array-(nsstring *) lastpathcomponents // extract the last part of the channel (generally the file name)-(nsstring *) pathextension // extract the file extension-(nsstring *) stringbyappendingpathcomponents: path // Add the path to the end of the existing path-(nsstirng *) stringbyappendingpathextension: EXT // Add the ext extension to the end-(nsstring *) stringbydeletinglastpathcomponents // Delete the last part of the path-(nsstring *) stringbydeletingpathextension // Delete the last extension-(nsstring *) stringbyexpandingtildein Path // convert each path in the path "~ "Symbol to the user's main directory (~) Or the main directory of a specified user (~ User)-(nsstring *) stringbystandardizingpath // resolution ~, Parent directory (..), current directory (..), and symbolic link to return a canonicalized path

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.