<p>I am looking for a clear, complete example of programmatically deleting all documents from a specific document library, via the Sharepoint object model.  The doclib does not contain folders.  I am looking to delete the documents completely (ie I don't want them in the Recycle Bin).</p>

<p>I know of SPWeb.ProcessBatchData, but somehow it never seems to work for me.</p>

<p>Thanks!</p>

You just have to go through all the files of your Document Library.
```
```
foreach(SPListItem item in SPContext.Current.Web.Lists["YourDocLibName"].Items)
{
    //TODO: Verify that the file is not checked-out before deleting
    item.File.Delete();
}
```
```
Calling the delete method on a file from the API doesn't use the recycle bin. It's a straight delete. You still need to verify that the file is not checked-out.
Here is some reference:
SPList
SPListItem
SPFile