From: Joakim Langvand Date: 2012-08-29T18:33:06+09:00 Subject: Re: Dir.mkdir appending question mark after directory name Thanks, Robert! That helped :) I suppose pname.chomp! would mean the same as pname = pname.chomp then. Didn“t think of that.. Robert Klemme wrote in post #1073741: > On Wed, Aug 29, 2012 at 10:51 AM, Joakim Langvand > wrote: >> Hi all >> >> Im starting to laern Ruby, but ive encountered this strange problem. >> This is my code: >> >> pname = gets >> pname.chomp > > You are missing an exclamation mark: > pname.chomp! > > The method without returns a new object but does not modify your > pname. You can see that by inserting > > p pname > > before creating the directory. > >> Dir.mkdir(pname) >> >> If I enter test for pname, the resulting folder is named "test?". What >> am I doing wrong here? > > See above. > > Kind regards > > robert -- Posted via http://www.ruby-forum.com/.