Skip to main content
15-Moonstone
April 11, 2019
Solved

File Locking issue

  • April 11, 2019
  • 2 replies
  • 1584 views

Hi,

 

I have a test case as following

 

var testfile = 'test.txt'

me.CreateTextFile({ path: testfile, data: 'Hello, world!', overwrite: true }) // WORKING

me.CreateTextFile({ path: testfile, data: 'Good morning!', overwrite: true }) // WORKING

me.LoadText({ path: testfile }) // WORKING

me.DeleteFile({ path: testfile }) // NO ERROR, but the file isn't deleted me.CreateTextFile({ path: testfile, data: 'Bye bye!', overwrite: true }) // ERROR

ERROR: Wrapped java.lang.Exception: Unable to Create File [test.txt] Cause: Unable to Create File [test.txt]

 

My Bests,

Hung Tran

Best answer by htran-21

Hi,

 

FYI, this is a known bug fixed by TW-36598 on Apr 3 2019 and applied for all Thingworx versions 7.4.19+ 

 

My Bests,

Hung Tran

2 replies

20-Turquoise
April 12, 2019

Will it delete the file if you don't load it?

 

When you load the file, temporary locking occurs and until it's released, it won't delete.

 

What version of ThingWorx are you on?

htran-2115-MoonstoneAuthor
15-Moonstone
April 12, 2019

Hi posipova,

 

Yes, the file would be deleted if that's not loaded yet.

 

No, that's not a kind of temporarily locking, I believe that's a bug in code of reading a file content.

 

It is Thingworx 7.4.1-b62

 

My Bests,

Hung Tran

20-Turquoise
April 12, 2019
I recall this being an issue in older versions. This should be fixed in latest patches on 8.x releases
htran-2115-MoonstoneAuthorAnswer
15-Moonstone
May 29, 2019

Hi,

 

FYI, this is a known bug fixed by TW-36598 on Apr 3 2019 and applied for all Thingworx versions 7.4.19+ 

 

My Bests,

Hung Tran