Your problem is most likely permissions are not set for the directories under IIS.
IIS runs as a system process and when it tries to access folders it basically has the rights of "guest" on the WinNT systems. which does not have the much access by default
So what ever folders you want to have access to you must grant IIS user rights to the directory.
mkdir() and fopen() are working just fine for me with IIS5 and IIS6