Possible Duplicate:
Get all folders of URL
I have this directory:
NSString *tmp = @"http://192.168.0.13/dev/doc/";
In this directory there is a pdf file called “file_01.pdf”, is there a way to know name file if I have only path?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question could be a wee bit more clear here.
1)
Is the name of that file already part of the path?
NSString has a very handy method called “
lastPathComponent“ that may work well for you here.2)
Or, if you have the parent folder path but don’t have the names of the files just yet, you need to get an array containing the filenames within that folder.
Which you can do via a NSFileManager method named “
contentsOfDirectoryAtPath:error:“ that you can use to get the contents of that folder.