Folder check

Hi guys

I am developing a program for printing serial.
But i am stuck on how to detect if folder is existing.
Sample folder name is "C:\\PrintLogs"
This folder will be use for Pringlogs.txt.

I want to detect if existing. If existing i will not create
new folder. If not then create new one.

Help guys.

thanks in advance
I might be wrong but that might be platform dependent. I know file checking is a pretty universal thing, but Checking for a folder might be dependent on file system.
thank you for your response.
But do you have any idea how can i solve this??

regards,
heh, sorry i wasn't much help earlier, Umm post some of your code and I'll give it a look. Unless you havent got any for the function(s) your working with, in which case, let us know what system your running.
In Unix, you can attempt to open the directory with opendir. On Windows, you can use FindFirstFile to get information about the directory. If these functions fail, they're not available to you (either they don't exist or you don't have access).
On Windows, there is also the special file called "nul", which is essentially a character sink.

You can check for folder existance if said file exists.
if exist D:\MyFolder\nul echo yeah
Guys thanks so much for all your feedback.
I already fixed my problem.
I used DirectoryExist

regards to all,
Topic archived. No new replies allowed.