Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
Quick question. I am checking to see if a directory exists on my server. Would I use NSFileManager or something with NSURL? I have been reading the docs but I am not sure if NSFileManager can be used to check if files or directories exist at a give website?

Was not sure if NSFileManager was used for internal computer / iphone file searching or if it is irreverent where it searches for files, web or internal directories?

Thanks!
 

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
OK, that would explain why it cant see a directory I created on my server and it is returning false.

Thanks.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
There are no files or directories on the internet. All that exists are services. In order to find things out about a server you have to ask a service that runs on that server.

A web server can respond with documents if you ask it. There's not a direct way to ask a web server about folders, that I can think of.
 

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
ahhh, it is more complex then I thought. I used Transmit ftp program to create a folder on my site. Before I start to load images and text files I wanted to verify that the folder existed first before it tried.

I used the NSFileManager to locate files and folder on my Mac and iPhone but not the web yet. It got confusing for me today reading the docs because it seems you can use fileAtPath and fileAtRUL to accomplish the same tasks, on the computer or iPhone. I thought fileAtPath, which I use, was for searching for files and directories within my computer / iPhone and anything URL was the internet.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
ftp is one of those services that can live on the internet.

For various reasons Apple has added a bunch of APIs that take URLs. Some of these use http:// URLs and will download/upload from the internet. Others are strictly file URLs only. It can be difficult to tell which is which.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.