I have a file which is placed in C:\mtn-2\mtn-2.2\logs\messages.txt, if am trying to open this file via script it says no such file or directory, so I have created another file called a.txt in the same location and tried to open via ruby script its working file. messages.txt file am able to rename/modify manually but the same it not working through the script. Am working on windows xp.
The code which I have written is :开发者_如何转开发
f=File.open("C://mtn-2//mtn-2.2//logs//messages.txt", "r") // not working, this is created by some tool,
f=File.open("C://mtn-2//mtn-2.2//logs//a.txt", "r") // its woking, this is created by me.
Waiting for your early reply
The messages.txt file should be closed before it is opened by your program for reading.
精彩评论