Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File created by the application is locked by some unknown user.

Status
Not open for further replies.

janak vyas

Technical User
Jun 3, 2020
47
0
0
IN
The foxpro application that I use, on click of a list item in the menu creates a template file in a folder placed in the D:/Shortcuts/Sharedfolder/Template/B .. where in the properties of B folder the target is \\SERVER\BMar2006pf92014\TEMPLATES.

Please understand this.
This is the main folder that is the path to all the files one of my foxpro application uses

\\SERVER\BMar2006pf92014\TEMPLATES

The TEMPLATES folder of the folder BMar2006pf92014 ( application folder ) is then renamed to "B" in D:/Shortcuts/Sharedfolder/Templates/B.

What happens is, is that a .dbf file get created which is used as an template to input data into the fields as it is opened using LibreOffice, it is saved.. and when in the application an item in the menus is clicked that file goes back to \\SERVER\BMar2006pf92014 from where the data is given back to the application from whic further processing is been done.

( if I made myself clear upto this, I should get a pat on the back, if not I need to improve and have failed )

The problem is this for that past few months this all process was working flawlessly ! today what happens is weird... when the file is being created and comes to D:/Shortcuts/Sharedfolder/Template/B, the LibreOffice file does not gets open as original file, what it means I cannot edit this file I cannot delete this file, I cannot save this file, only I can do is Open a copy -> save it to desktop -> and never use it again, as only the files that are in the folder D:/Shortcuts/Sharedfolder/Template/B goes back to \\SERVER\BMar2006pf92014 and get used.

I contacted the Microsoft Advisors, hoping this would be some issue with permissions, 2-3hrs went in, and no solutions was reached. As even I think it is related with some foxpro...

What weird is that, the same process was running fine since 7-8 months and on other pc's it still runs the way it should be, but on the SERVER pc it is not running as it is supposed to be.

error_y3hzue.png


Please help if anyone has any idea.
 
This error comes from Libre Office, doesn't it?

The only thing you could be doing wrong in VFP is after you create this DBF, keep it open. Files you create as new dbfs, no matter if fox2.x or part of a dbc, are open exclusive to the creating process. To let other processes use the file, you have to close it.

So in any PRG doing a CREATE TABLE, after its there, close it with USE or CLOSE ALL or CLOSE TABLES ALL. Perhaps if it's not a big problem even quit from the exe.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Well,

and obviously, since it worked for a long time, you usually do close dbfs you create.
But then is it LibreOffice, that opens a dbf exclusively again?

You can use the Server's Computer Management console to find out which files are used by whom, so log in to that server open computer management, drill down system->shared folders->open files and you see which user has the file open. Note: This will only show file usage from clients opening files in your shares via the LAN.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Could it be a timing problem?
Maybe do a FLUSH FORCE in VFP after closing the table?
Eventually also Sleep a bit before starting Libre Office?
 
What are you doing in code?

By the way, I would also be surprised if any software like an office suite running with normal privileges could tell you which other user has a file handle. This is something you only find out at the fileserver and with administrative privileges. So I wonder why LibreOffice actually has this message that is formatted as if it could also display a user name in this separete line.

Since usually only your application and LibreOffice (started by your application?) are involved the user would be your application user. I'd assume you're stepping on your own foot anyway. But one other common "User" would be system or some system account running antivirus. If you use that share only for your dbfs, it would be acceptable to exclude the share from scanning. Because right after the file is created and you close it would be a time I'd also expect antivirus to open the file and check it. And if you start LibreOffice at the same time and pass in the file to open in LibreOffice, it would be no wonder this file has too many users and processes interested in it at the same time.

And as antivirus software updates automatically, usually just with new virus definitions (data for what to scan), behavior changes are rare, but there always is some first time. Such a change in behavior can start anytime through updates of Windows, antivir, and LibreOffice. And what else not, an automatic live backup like time machine saving all files when they come or change.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top