Exception while creating new PST in low disk space

Following exception was thrown while trying to create a PST file in a disk with low space.

class com.aspose.email.system.exceptions.IOException: File was not deleted: F:\test.pst
com.aspose.email.internal.n.ze.b(Unknown Source)
com.aspose.email.PersonalStorage.create(SourceFile:336)

At certain other times, the following exception was thrown.

com.aspose.email.system.exceptions.FileNotFoundException: File not found File: F:\test.pst
File name: ‘F:\test.pst’ —> F:\test.pst (There is not enough space on the disk)
com.aspose.email.internal.ev.zd.(Unknown Source)
com.aspose.email.internal.ev.zd.(Unknown Source)
com.aspose.email.internal.ev.zd.(Unknown Source)
com.aspose.email.system.io.FileStream.(Unknown Source)
com.aspose.email.system.io.FileStream.(Unknown Source)
com.aspose.email.PersonalStorage.create(SourceFile:326)

It would be better if the error messages are consistent and also the PST file that got created was not released properly and hence cannot be accessed by any other program.

@nandhini.r.17.96,

Can you please share source code so that we may further investigate to help you out.

Hi @Adnan.Ahmad, the source code does nothing but call this method, PersonalStorage.create(filename, 0). Just check this method to create a PST in a disk that has less free space, say less than an MB.

@nandhini.r.17.96,

I like to inform that you should control such errors yourself and handle them properly. Checking for disk space issues is beyond the scope of our product.

@Adnan.Ahmad, Okay then. But there is this problem that the PST file that got created was not released properly and hence cannot be accessed by any other program.

@nandhini.r.17.96,

I have observed your following comments. Can you please elaborate this point and share how it can be reproduced.