THE archives of one of Scotland's most successful living writers is to enter the vaults of the national collection.

Ian Rankin, the Scottish novelist and creator of the best selling Inspector Rebus novels, has arranged for an archive of his work, letters and papers to go to the National Library of Scotland.

Nineteen boxes of his papers are to be transferred by the writer to the institution, he has revealed in the latest edition of Literary Review.

The writer, who studied the works of Muriel Spark at the University of Edinburgh, notes that his materials are going to the same national institution as Ms Spark - indeed, Mr Rankin helped the fund raising effort for her archive to be bought by the library.

A spokesman for the National Library of Scotland confirmed it was discussing the archive with the Edinburgh-based writer, who writes of his efforts to "down size" as he moves to a new flat.

The archive will now rest in the same place where Rankin - like many post-graduate students at the university - worked on his PhD thesis.

Now his own papers will be available to be scrutinised by students of literature and Scotland for years into the future.

READ MORE: Rankin on two faces of Rebus, on stage and screen

Rankin writes that he had gone through every paper item, "lest there be something there I don’t want anyone seeing".

After shredding financial material, recycling other papers, and giving books and music to charity, he said he has collated nineteen boxes.

Rankin says that the process of reducing his belonging has been "a reckoning, and it is proving cathartic."

He notes: "There were many moments of poignancy along the way.

"I lived in France between 1990 and 1996 and kept in touch by writing letters.

"Many of my correspondents – Iain Banks, Reginald Hill, Ruth Rendell, Michael Dibdin, to name but four – are no longer with us.

"Their letters to me will be within the nineteen boxes soon to be on their way to the vaults of the same building where I did most of the work on my (never finished) thesis.

"Now there’s a dance to the music of time that might have pleased Anthony Powell."

READ MORE: Rankin on the new Rebus play, and TV drama

Rankin notes that the archive was "requested" by the NLS, although there are no other details of the transaction.

A spokesman for the National Library of Scotland said: "We are currently in negotiations regarding Ian Rankin’s archive.

"Like all our ongoing negotiations, these are strictly confidential.

"It would be inappropriate for us to comment further."

The National Library of Scotland, based in Edinburgh, holds more than 26m items, and uses its resources to stage exhibitions, such as the recent major exhibition dedicated to the works of Muriel Spark.

Inspector Rebus has recently made the move from the page to the stage, and the play, Long Shadows, is due to open at the King's Theatre in Edinburgh next week.

Rankin recently released a new Rebus novel, In a House of Lies.

He also spoke of Inspector Rebus once again returning to television.

READ MORE: An interview with Rona Munro, playwright

Gregory Burke, the lauded writer who wrote Black Watch, the much-lauded National Theatre of Scotland play, is working on the script for the new television version of Rankin's famous character, the writer said.

Rankin, speaking at the Edinburgh International Book Festival, said that it will a long-form drama, with stories depicted over several hours of television.

Rankin said: "A production company [Eleventh Hour Films] came to me last year and said they would do it properly, over six, eight, ten hours.

"They've taken on board a writer who is very good, and he is working on it just now,

"He wants to have a young Rebus, a Rebus who is in his 40s or 50s, so I don't know whether it would be a project for Ken Stott or not.

"But if it happens at all it will happen next year, not this year."

Long Shadows has been written by Rona Munro, the writer who also wrote The James Plays for the National Theatre of Scotland.

Charles Lawson will star as Rebus, Cathy Tyson as Siobhan Clarke and John Stahl as Cafferty.

Rankin said he had been thrilled to work with Munro.

"Rona is great on character, great on the internal workings of them.

"I did stretch me, to think of these characters in a different way."