Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 5 Monaten, 3 Wochen
Letzter Beitrag:
vor 5 Monaten, 3 Wochen
Beteiligte Autoren:
Sivaprakash, Piet van Zanten

Re: Could not Delete HFSQL (Classic) folder

Startbeitrag von Sivaprakash am 22.01.2018 03:16

Hello,

Would like to delete a folder where hfsql - classic files are stored. I do read those files first then give the user the option to delete the folder altogether. I get the following error.

Unable to delete directory. Check whether you have sufficient rights and whether all the files are closed.

My code to delete

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
WHEN EXCEPTION IN
HClose("*")
HCloseConnection(a360_DataBaseConnection)
DO
Info("HFSQL error while closing connections: " + HError() + HErrorInfo())
a360TransactionCancel(a360_DatabaseConnectionType, a360_ClassicDatabaseTRS, p_sErrorMessage)
RESULT False
END

e_resdelete = fRemoveDir(CompleteDir(a360_classicDir) + p_sCompanyFolder, frRecursive)
IF e_resdelete = False THEN
Info("Directory could not be removed. Check whether you have sufficient rights" + ErrorInfo())
RESULT False
END

// OK Return True
RESULT True

////////////////////////////////////////////////////////////////////////////////////

I get error while executing fRemoveDir command. Seems some files are still open that the folder could not be deleted.

When the folder is deleted from Windows explorer or command prompt, after closing the package, it deletes without any issues.

Would like to know what else I'm missing?

Happiness Always
BKR Sivaprakash

Antworten:

Re: Could not Delete HFSQL (Classic) folder

Hi Sivaprakash,

You could try and see what happens if you don't use a connection to open the classic files.
Perhaps the connection -even if closed- uses some kind of locking mechanism.

Kind regards,
Piet

von Piet van Zanten - am 23.01.2018 09:34

Re: Could not Delete HFSQL (Classic) folder

Thanks Piet.

Looks like a wrong place of closing files and closing connection.

Before deleting the directory, I used to read files and display those details in a table. I just tried closing the files after display there itself.

Now I could delete the folder.

Happiness Always
BKR Sivaprakash

von Sivaprakash - am 27.01.2018 11:10
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.