Announcement

Collapse
No announcement yet.

Reading an open file (When opened for append)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading an open file (When opened for append)

    If I have a program that MAY or may not be opened for append (I won't know), is there a way to safely detect it?
    I mean I could do a function and test for it but I want to read the contents of a file that is opene append lock read write


    Can it be done? I'm getting weird errors trying it now, I know the file exists, I test for existence, but if the file is opne I get an error 53 (not found)..


    Scott

    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    If the file is already opened with LOCK READ WRITE (from elsewhere in your code or even in another process) then you will not be able to open that file.

    However, if you have the PB file handle, you can test the file mode (APPEND, etc) with FILEATTR(), but FILEATTR() cannot determine the lock mode.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X