C
Chris Dwan
I have a problem with a script I'm working on. File.exists? is
telling me that a file does in fact exist, then immediately after
when I try to do a File.read, it crashes because the file doesn't
exist. I know that it does not exist, because I'm testing that
condition. If the file doesn't exist, it should do something else.
<sigh> this is on Windows, so maybe the OS is to blame?
Here's the code, if it helps..
$debug_log.fatal("does file exist? :: #{ibl}")
if File.exist?(ibl)
$debug_log.fatal("YES - it most certainlyt does!")
iblLocation = ibl
else
#find the file and set iblLocation
end
File.read(iblLocation) # << bombs here
The file referred to by ibl was recently renamed by this same script,
so the file name in ibl is no longer valid. The script should then go
looking for ibl's new name and use that... but it won't work <sob><sob>
Hope someone can enlighten me.
Thanks!
telling me that a file does in fact exist, then immediately after
when I try to do a File.read, it crashes because the file doesn't
exist. I know that it does not exist, because I'm testing that
condition. If the file doesn't exist, it should do something else.
<sigh> this is on Windows, so maybe the OS is to blame?
Here's the code, if it helps..
$debug_log.fatal("does file exist? :: #{ibl}")
if File.exist?(ibl)
$debug_log.fatal("YES - it most certainlyt does!")
iblLocation = ibl
else
#find the file and set iblLocation
end
File.read(iblLocation) # << bombs here
The file referred to by ibl was recently renamed by this same script,
so the file name in ibl is no longer valid. The script should then go
looking for ibl's new name and use that... but it won't work <sob><sob>
Hope someone can enlighten me.
Thanks!