Hey there,
I am wondering and I haven't been able to find it anywhere, is there a simple way to detect an OS.
I am writing a cookie killer program to run mainly on my NT5 box, but I also want it to be directly portable to NT4 and win9x machines.
So far my 'beta' version runs well on my machine, where I have hard coded the path to my 'Documents and Settings' folder, and for the win9x version I have simply hard coded the search for a cookie file name pattern to start at C:/
This so far is a bit clumsy, like breaking a wall nut with a sledge hammer, and since my own machine has the OS on the F:/ drive, but generally it's on C:/ , I was wondering if there is a way to say; search all drives for a folders called windows || winnt and that is the drive to start with for finding the cookies.
I have tried hostname(); but that is just the computer name, and Cwd gives the path of my perl file.
Also is there a 'get logged in user's username' type command?
Any pointers would be great.
Cheers
Jez
I am wondering and I haven't been able to find it anywhere, is there a simple way to detect an OS.
I am writing a cookie killer program to run mainly on my NT5 box, but I also want it to be directly portable to NT4 and win9x machines.
So far my 'beta' version runs well on my machine, where I have hard coded the path to my 'Documents and Settings' folder, and for the win9x version I have simply hard coded the search for a cookie file name pattern to start at C:/
This so far is a bit clumsy, like breaking a wall nut with a sledge hammer, and since my own machine has the OS on the F:/ drive, but generally it's on C:/ , I was wondering if there is a way to say; search all drives for a folders called windows || winnt and that is the drive to start with for finding the cookies.
I have tried hostname(); but that is just the computer name, and Cwd gives the path of my perl file.
Also is there a 'get logged in user's username' type command?
Any pointers would be great.
Cheers
Jez