I have been trying to remember a story I read from my childhood; I believe this one was a short story, but I honestly can not remember.
The story is about a boy who likes to play around an old army fort. I am pretty sure he is told not to, but his curiosity got the better of him, and he continued to go back to it, and eventually discovered that it was haunted.
The ghost haunting the fort led the boy to a mysterious room that was filled with books, but when the boy entered, the door closed on him. The ultimate twist was that this room would only open once every decade or so, and required that someone always be inside. The books were there to keep the prisoner entertained, and the ghost was that of the last boy who found himself trapped. The ghost promised to return, when the door reopened, to trade places with the boy once more.
I would have read this story during the mid to late 90s, and it was in English. I am sure I read it in a book of stories, but my school use to subscribe to a young-adult reading magazine, so I may have read it from that. I am also sure the story was set in my country, Australia, but again, I could have been mistaken. I initially thought I was remembering a Paul Jennings story, but having looked through all of his stories on Wikipedia, I can not find the story I am thinking of.