From: 7stud -- Date: 2009-08-14T18:01:22+09:00 Subject: Re: newbie question making a folder with ruby Simon Staton wrote: > Fleck Jean-Julien wrote: >> Hello, >> >>> all that is doing is adding a new toolbar and opening somthing called a >>> components panel. now is it possible to add code in here that will >>> create a folder on there C: called temp and if it is already there dont >>> overwrite it. >> >> Sure. >> I'll suppose you are on a UNIX system type (I do not know that sort of >> thing on windows, perhaps, it is as simple as changing /temp by >> c:/temp or c:\temp) >> >> Just add: >> >> dir = "/temp" >> >> if File.exist?(dir) >> puts "#{dir} already exists !" >> else >> Dir.mkdir(dir) >> end >> >> Cheers, > > ok I have got another error this is the error it is giving, > http://www.actinictesting.co.uk/error.jpg > > any ideas? I am a noob when it comes down to programming etc and have > oinly ever used ruby on plugins. so im not sure what a unix stystem type > is Unix is another type of operating system. There are numerous versions of unix that are slightly different, so a "unix system type" is an awkward way to refer to any of the unix operating systems. >> but if it helps im on windows :D Have you seen The Matrix? Run this program: puts dir Compare the output to the output you are getting. > I am a noob when it comes down to programming Ok, noob. Here is the way it works. You post your code, or better yet: you construct a small example that duplicates your error and post that. Then you post the exact error message, AND you put a comment in your code indicating what line the error is on. -- Posted via http://www.ruby-forum.com/.