NSString (nsstringpathextensions)

Source: Internet
Author: User

+ (NSString *) pathwithcomponents (Nsarray *) components
The path is built according to the elements in the components.
-(Nsarray *) pathcomponents
Parses the path and returns the parts that make up the path.
-(NSString *) lastpathcomponent
Extract the last component in a path
-(NSString *) pathextension
Extract the extension from the last component in the path
-(NSString *) stringbyappendingpathcomponent (NSString *) path
Add path to the end of an existing path
-(NSString *) stringbyappendingpathextension (NSString *) ext
Adds the specified extension to the last component of an existing path
-(NSString *) stringbydeletinglastpathcomponent
Delete the last component in a path
-(NSString *) stringbydeletingpathextension
Remove the extension from the last part of the file
-(NSString *) Stringbyexpandingtildeinpath
Expands the generation of characters in the path to the user home directory (~) or the specified user's home directory (~user)
-(NSString *) Stringbyresolvingsymlinksinpath
Attempt to parse a symbolic link in a path
-(NSString *) Stringbystandardizingpath
Parse the path of ~, (..) Parent directory, (.) The current directory and symbolic links to standardize the path.

Common Nsprocessinfo classes (process-dependent)
+ (Nsprocessinfo *) ProcessInfo
Returns the current process information
-(Nsarray *) arguments
Returns the parameters of the current process in the form of a NSString object number
-(Nsdictionary *) environment
Returns a dictionary of variable/value pairs to describe the current environment variables (such as path, etc.)
-(int) processidentifier
Return to process PID
-(NSString *) processName
Returns the name of the process that is currently executing
-(NSString *) globallyuniquestring
Each time the method is called, a different single-value string is returned, and a temporary file name can be generated
-(NSString *) hostName
Return host system name
-(Nsuinteger) OperatingSystem
Returns the number that represents the operating system
-(NSString *) operatingsystemname
Returns the name of the operating system
-(NSString *) operatingsystemversionstring
Returns the operating system version
-(void) setprocessnamensstring *) name
Modify the current process name (use sparingly)

Basic file Operation class: Nsfilehandle
The Nsfilehandle class does not provide a way to create a file, so creating a file requires using the FileManager method to create it, and the file action method in the Nsfilehandle class assumes that the file exists and returns nil if it does not exist.
Common methods of Nsfilehandle:
+ (ID) filehandleforreadingatpathnsstring *) path
Open a file ready to read
+ (ID) filehandleforwritingatpathnsstring *) path
Open a file ready to write
+ (ID) filehandleforupdatingatpathnsstring *) path
Open a file for update (read and write)
-(NSData *) availabledata
Returning available data from a device or channel
-(NSData *) readdatatoendoffile
Reads the rest of the data until the end of the file (maximum value for unsigned shaping)
-(NSData *) readdataoflengthnsuinteger) length
Reads the contents of a specified number of bytes from a file
-(void) writedatansdata *) data
Write data to File
-(unsigned long long) offsetinfile
Gets the offset of the current file
-(void) seektofileoffsetunsigned long long) offset
Sets the offset of the current file
-(unsigned long long) seektoendoffile
Positions the offset of the current file to the end of the file
-(void) Truncatefileatoffset: (unsigned long) offset
Set the length of the file to offset bytes (the content can be populated, if desired)
-(void) CloseFile
Close File
-(BOOL) Filehandleforreadingatpath
Whether the file is readable
-(void) Filehandleforwritingatpath
Whether the file is writable

NSString (nsstringpathextensions)

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.