Przemek:

1)  The DO WHILE loop (3rd example out of my list of three examples) I ran
in the first message in this thread actually will return the decimal data.
In my post, it couldn't find the file, because it's attrib was +h, hidden.
:)

2)  The first two " ? FILEATTR " examples I wrote, are indeed a bug like you
mentioned.

3)  What my goal is, is to simply implement an attribute changer, to remove
things like -h, -s, -r dos attrib switches a file... without having to read
in the current bitwise decimal, do an AND / XOR on it, and then reset it.
FUNCKy lets you avoid all that by you supplying a T/F flag that either sets,
or disables the attribs, based simply the bitwise decimals you want to
adjust.  Is there an HB_ function to do this?  I looked at the change log
and grep'd around, but couldn't make sense out of some of the stuff because
it wasn't documented.  Please give me a hint, if any.  If there isn't one to
do this, can you suggest a safe way for me to program it, without me having
to worry that in any new versions of Harbour, my code might break due to
your bugfixes?

Thank you for everything


2010/1/30 Przemysław Czerpak <[email protected]>

> On Sat, 30 Jan 2010, smu johnson wrote:
> > It appears the FILEATTR() function doesn't work.
> > According to http://www.ousob.com/ng/tools1-3/ng935ab.php , it says it
> > should return a bit-wise decimal number.  I tried a few different ways...
> > absolute path, relative, and a piece of code my brother found from the
> > Harbour source files.
> > ___Pre-test:
> > C:\hbm>attrib hello.prg
> > A   H        C:\hbm\hello.prg
> > ___Result:
> > C:\hbm>hello.exe
> >          0
> >          0
> >          0
> > ___code
> > FUNCTION main()
> >   ? FILEATTR("hello.prg")
> >   ? FILEATTR("C:\hbm\hello.prg")
> > cFile  :=  FILESEEK("hello.prg")
> > DO WHILE .NOT. EMPTY (cFile)
> >   ? cFile, FILEATTR()
> >   cFile  :=  FILESEEK()
> > ENDDO
> > return
> > // end
> > Have I found a bug? :3
>
> Yes, Thank you very much for the information.
> The problem is only in MS-Windows builds and it's caused by wrongly
> written emulation of DOS volume label attribute in hb_fsFindFirst()/
> hb_fsFindNext().
> Additionally as I can see it's partially hacked in DIRECTORY() function
> so I cannot fix it immediately. I'll fix it later.
> Anyhow in current code we can remove yet another hack from FILEATTR()
> implementation which also resolve the problem.
>
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour
>



-- 
smu johnson <[email protected]>
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to