0

I have a WAMP that writes (very often) the logs in a file.

If I delete that file (using Shift + Delete) it disappears for a moment, then it appears back (having the same size, not 0).

  • When I try to open it with Notepad it says:

    Access denied

  • When I try to open it with Notepad++ it says:

    file doesn't exist. Create it?

    • If I select "Yes" it shows:

      Cannot create the file "file".

  • When I run from cmd:

    type file
    

    it shows:

    Access is denied.

  • When I run from cmd:

    dir /Q
    

    it shows ... for that file, while for a normal file it shows BUILTIN\Administrators (where /Q means Display the owner of the file.).

  • When I restart the server, the file is deleted.

Questions:

  1. What is the status of this file? (it has to have a special status if trying to access it has a different behavior)
  2. How can I change this status to a consistent state? (to be readable)
  3. How does delete work in this case? Is it placed into a queue and executed only after the file is "released"?
2
  • Hint: This might depend on the file system and/or Windows version you use.
    – Run CMD
    Feb 1, 2016 at 9:19
  • 2
    Theres an open handle on the file which locks it, thats how the OS/FS prevents multiple processes writing to the same file at the same time. When WAMP shuts down gracefully it should release all its handles. Manually killing its handle can be done but may cause undesired behavior or a crash.
    – Linef4ult
    Feb 1, 2016 at 11:00

0

You must log in to answer this question.