Naming convention for files generated by mailtodisk

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Naming convention for files generated by mailtodisk

Postby jdj » 24. May 2022 10:48

Hello,
I would like to know the rules for naming files generated by mailtodisk.
ex) mail-20220524-0901-98000.txt
What do the numbers in the last hyphen-separated part '98000' mean?
jdj
 
Posts: 2
Joined: 24. May 2022 10:41
XAMPP version: 3.3.0
Operating System: Windows10

Re: Naming convention for files generated by mailtodisk

Postby Altrea » 24. May 2022 12:21

Hi,

The code of \xampp\src\xampp-mailToDisk\src\mailtodisk.py says the following
Code: Select all
filename = "mail-%s-%s.txt" % (strftime("%Y%m%d-%H%M", gmtime()),dt.microsecond) # filename with date + time + milliseconds

So the last parts are the microseconds.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Naming convention for files generated by mailtodisk

Postby jdj » 24. May 2022 17:20

Thank you so much, Altera!
Until now I didn't know that the source for mailtodisk was in that directory.
I'm suspicious that the string doesn't contain a second field.
Therefore, I decided to modify and use it as follows.
Code: Select all
filename = "mail-%s-%s.txt" % (strftime("%Y%m%d-%H%M%S", gmtime()),str(dt.microsecond).rjust(6, '0'))

(I'm very new to python coding, so let me know if there's another smart way.)
After making this change, I created an .exe with pyinstaller and replaced the original mailtodisk.
sorting the contents of 'mailoutput' dirctory by file name, it will match in chronological order.
I'm happy to see this.
jdj
 
Posts: 2
Joined: 24. May 2022 10:41
XAMPP version: 3.3.0
Operating System: Windows10

Re: Naming convention for files generated by mailtodisk

Postby Altrea » 24. May 2022 17:42

jdj wrote:Until now I didn't know that the source for mailtodisk was in that directory.

XAMPP bundles only open source applications. All of XAMPPs own developned binaries can be found in the src folder as sourcecode.
Feel free to use and modify them however you want to.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 122 guests