From: Robert Klemme Date: 2011-09-22T20:45:05+09:00 Subject: Re: Unable to close the file, opened using ftp. On Thu, Sep 22, 2011 at 11:37 AM, Saurabh A. wrote: > Hi > >    args = Hash.new >    args[:SRCHOST] = ENV['AUTO_HOSTNAME'] >    args[:SRCUSER]  = "root" >    args[:SRCPASSWD] = "" >    remotefile = File.basename('GlobalText.xml') >    localfile  = File.basename('GlobalText.xml') >    ftp = Net::FTP.new(args[:SRCHOST], args[:SRCUSER],args[:SRCPASSWD] ) >    ftp.chdir('/usr/ui/xui/localServerHome/language/en-US') >    ftp.gettextfile(remotefile, localfile) >    xmldoc = Document.new(File.new(localfile)) Try this instead xmldoc = File.open(localfile) {|io| Document.new(io)} > I have a problem in above code, when i am trying to delete the localfile > created on local disk, it is giving error saying access denied. How can > i delete the local file. For deleting am using File.delete(localfile). > > Thanks in advance. Please help me in deleting. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/