Zero Length Files

Results 1 to 6 of 6

Thread: Zero Length Files

  1. #1
    Andrew A. Guest

    Default Zero Length Files

    I am having a hard time determining how to test for zero length files. I have an asp routine that reads a particular file and for some odd reason the application (completely separate) that creates the file doesn&#039;t finish its business. Instead it leaves the file open and as a zero length file. When asp goes to get the file, it can&#039;t and returns an error "Permission denied." I want to avoid that error.<BR><BR>Thank you,<BR>Andrew A.

  2. #2
    Joel N Guest

    Default RE: Zero Length Files

    If the user account that the web server is impersonating to access the file SHOULD have access to it (usually that&#039;s the IUSR_MACHINE_NAME account) then the problem is that the other process that is creating the file still has it open, so your routine can&#039;t get a handle to it. If the file is correctly created and your routine works then the problem lies with other process that&#039;s generating the file.<BR><BR>HTH

  3. #3
    Andrew A. Guest

    Default RE: Zero Length Files

    Yep...I know that. I am just trying to prevent the error from showing because as it now stands, my Web site gets blamed for the error when in fact the error is with the other process. So....not that I care about blame, I would rather send an error page that says how to resolve the issue. It is a predicament because the file really doesn&#039;t exist yet I am asking asp to tell me the details of it. I have advised the people who developed the other app of this problem, but unfortunately it isn&#039;t really high on the list. Does that make sense?

  4. #4
    Join Date
    Dec 1969

    Default Trap that error

    Set fso = Server.CreateObject("Scripting.FileSystemObject")< BR>On Error Resume Next<BR>Set f = fso.OpenTextFile("c: estfile.txt")<BR>If Err Then<BR> &#039; Inform the user<BR> &#039; Some other process<BR>End If<BR>On Error GoTo 0

  5. #5
    Joel N Guest

    Default Excellent <eom>


  6. #6
    Andrew A. Guest

    Default RE: Trap that error

    Sometimes the obvious isn&#039;t as so.<BR><BR>Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts