# DSP python module

**URL:** <https://sleuthkit.discourse.group/t/dsp-python-module/3630>\
**Category:** Autopsy Help\
**Created:** [March 3, 2023, 2:25pm UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630 "2023-03-03T14:25:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grzesiug](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@grzesiug](https://sleuthkit.discourse.group/u/grzesiug)\
**Post date:** [March 3, 2023, 2:25pm UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630/1 "2023-03-03T14:25:04Z")

</div>

I’m trying to write data source processing module in python, can somone give me a tip how to add files to case, but with their properties like size, ctime, mtime etc.?  
Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_McKinnon](https://yyz2.discourse-cdn.com/free1/user_avatar/sleuthkit.discourse.group/mark_mckinnon/32/42_2.png) [@Mark\_McKinnon](https://sleuthkit.discourse.group/u/Mark_McKinnon)\
**Post date:** [March 3, 2023, 4:13pm UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630/2 "2023-03-03T16:13:19Z")

</div>

Are you looking at adding a few files or a lot of files that may reside in a directory?

---

<div class="post-metadata">

**Author:** ![grzesiug](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@grzesiug](https://sleuthkit.discourse.group/u/grzesiug)\
**Post date:** [March 3, 2023, 5:20pm UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630/3 "2023-03-03T17:20:12Z")

</div>

Lot of files in directories. It’s a copy of filesystem, files are in folders and their properties in xml file. I would like to add files with their orginal properties from xml file.

---

<div class="post-metadata">

**Author:** ![Mark\_McKinnon](https://yyz2.discourse-cdn.com/free1/user_avatar/sleuthkit.discourse.group/mark_mckinnon/32/42_2.png) [@Mark\_McKinnon](https://sleuthkit.discourse.group/u/Mark_McKinnon)\
**Post date:** [March 3, 2023, 6:37pm UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630/4 "2023-03-03T18:37:11Z")

</div>

Look at addDerivedFile

skCase = Case.getCurrentCase().getSleuthkitCase()  
derived\_file = skCase.addDerivedFile(see parameters below)  
IngestServices.getInstance().fireModuleContentEvent(ModuleContentEvent(derived\_file))

/\*\*  
\* Adds a derived file to the case.  
\*  
\* @param fileName The name of the file.  
\* @param localPath The local path of the file, relative to the case  
\* folder and including the file name.  
\* @param size The size of the file in bytes.  
\* @param ctime The change time of the file.  
\* @param crtime The create time of the file  
\* @param atime The accessed time of the file.  
\* @param mtime The modified time of the file.  
\* @param isFile True if a file, false if a directory.  
\* @param parentObj The parent object from which the file was derived.  
\* @param rederiveDetails The details needed to re-derive file (will be  
\* specific to the derivation method), currently  
\* unused.  
\* @param toolName The name of the derivation method or tool,  
\* currently unused.  
\* @param toolVersion The version of the derivation method or tool,  
\* currently unused.  
\* @param otherDetails Other details of the derivation method or tool,  
\* currently unused.  
\* @param encodingType Type of encoding used on the file, use this TskData.EncodingType.NONE  
\*  
\* @return A DerivedFile object representing the derived file.  
\*  
\* @throws TskCoreException if there is a problem adding the file to the  
\* case database.  
\*/  
public DerivedFile addDerivedFile(String fileName,  
String localPath,  
long size,  
long ctime, long crtime, long atime, long mtime,  
boolean isFile,  
Content parentObj,  
String rederiveDetails, String toolName, String toolVersion, String otherDetails,  
TskData.EncodingType encodingType)

---

<div class="post-metadata">

**Author:** ![grzesiug](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@grzesiug](https://sleuthkit.discourse.group/u/grzesiug)\
**Post date:** [March 4, 2023, 10:30am UTC](https://sleuthkit.discourse.group/t/dsp-python-module/3630/5 "2023-03-04T10:30:11Z")

</div>

Thank you Mark.  
What should I pass as

> - @param parentObj The parent object from which the file was derived.

to addDerivedFile method ?
