this is some thing I’m doing for my job, I figured I’d try it in ruby
instead of doing it in c++ with qt…
class Setup
attr_accessor :folder, :file
@folder.to_s
@file.to_s
end
class MakeListings
attr_accessor :website, :username, :password, :description
@website.to_s
@username.to_s
@password.to_s
@description.to_s
end
def Install()
@folder = gets.chomp
Dir.mkdir(@folder) unless Dir.exists?(@folder)
@file = gets.chomp
outfile=File.open(@file,“w+”)
outfile.close
Main();
end
def CreateWebsite()
wMessage_one = “\nPlease input the site for this listing”
puts wMessage_one
@website = gets.chomp
File.open(@file, “a+”)
file << “#{@website}”
file.close
CreateUsername();
end
#I would have indented but it kept cutting it off and making it look
#worse
Every thing works except for opening and writing to the file
the File path contains the absolute file path given by the user.
Example c:\Random Test
So the folder gets created
#and then c:\Random Test\Hello there.txt the text file is created
How can I open this text file and append it? It doesn’t seem to like
the #@file variable