Subj : Re: File object randomly thinks file is empty
To   : Nightfox
From : Tracker1
Date : Sat Jul 04 2009 02:56 pm

On 7/3/2009 8:55 PM, Nightfox wrote:
> Hi all.  I'm working on a JavaScript script for Synchronet - a logon matrix -
> and I've run into a weird issue with the File class.
>
> In my script, I want to open and read a configuration file that has options
> for the script.  The problem is that the File object sometimes thinks the
> file is empty (length property is 0), and other times it is able to read the
> file without any problems.  I can observe this just by running the script
> several times in a row.

Are you opening the file with shared read-only?  also, are you closing your
handle to the file when done, or otherwise encapsulating the file access into
a separate method/function, so the variable falls out of scope?

> When I create the File object, the filename that will get passed to it is
> something along the lines of this:
> D:\BBS\sbbs\mods\../xtrn/DigDist\DDLoginMatrixThemes/kd-snake/DDMatrixThe
> me.cfg
>
> Is there a known bug related to what I'm describing?  Might I simply be
> passing too long of a path to the File object?

I couldn't answer this, I can only suggest to be certain you are safely
accessing the file with shared read.  I can't offer more help than this
without knowing more about how your configuration structure is read.

--
Michael J. Ryan - http://tracker1.info/

... FRA #255: A wife is a luxury ... a smart accountant is a necessity.

---
� Synchronet � Roughneck BBS - telnet://roughneckbbs.com - www.roughneckbbs.com