netbeans is locking files and preventing saving source files - netbeans-8

when working on a remote project, netbeans frequently creates lock files. I get this error message when I try and save:
cannot write to locked file:
It doesn't state where the lock file is, and I don't see any obvious lock files.
The solution appears to be to abandon the file, and restart netbeans.
Is there a better way?

Related

It seems the file stream is not closed when it uses read command

I use read command for some read files in the scenarios.
If the tests are running, the files can not be moved and deleted.
It seems that the file stream is not closed when it uses read command.
Can it close the files as declarative?
Environment:
Karate 0.9.2
We are also writing log files and in some cases this can cause issues, see: https://github.com/intuit/karate/issues/661#issuecomment-458127918
But I think keeping a file lock is expected. Also we are closing files whenever we read them, but maybe we have a bug. So if you can create a sample project to replicate your problem, that would be great: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Flush IntelliJ cached directories

I have just started using IntelliJ, and I made an unsuccessful attempt at checking out a remote repository. I am trying to check out the code again into the same local directory, but IntelliJ keeps telling me that the directory is already in use.
I have deleted the config in IntelliJ, and deleted and recreated the local directory, but that doesn't seem to solve the issue.
How can I flush out these cached directories so that I can try my checkout again?
I was able to resolve this by going through the setup wizard and deleting the offending configurations. Once deleted I closed IntelliJ and re-opened it (probably overkill). I was then able to check out my code into the directory that I wanted.

Webpack sometimes fails to detect changes saved with Intellij Idea

I'm developing a JavaScript/React application in Intellij Idea and I'm using webpack-dev-server to incrementally build my files. That means that the dev server is watching the files and if a file gets changes, webpack rebuilds it. Pretty standard scenario.
Unfortunately, webpack sometimes decides to ignore certain files. I can change them all I want but webpack does nothing. I have not been able to determine any pattern on which files get ignored. It's arbitrary. Sometimes I just create a new file and webpack ignores it.
What is interesting though is that it only happens when I perform the save using Intellij Idea. If I open the file in another editor (for example vim) and save it, the file gets correctly rebuilt. Actually, simple touch file.js is enough to trigger rebuilding.
I guess there is something wrong in how Intellij Idea saves files. Any ideas?
This is due to an IDE feature known as "safe write". When enabled, the IDE will write the changes to a temporary file over the real one. This means webpack's file watching mechanism cannot pick up the changes. Disable this feature to fix the problem. Reference.
For me this did not work, I'm posting this in case anyone has the same scenario. After each save, webpack watch script builds the new bundles and I'm reloading all files from disk (CTRL + ALT + Y). Only after that the changes are visible.
There is an open issue "Background" changes by external tool not being picked up until VFS refresh happens regarding this behavior: file is saved but one has to reload all from disk in order to see the changes (for example in the browser).

___jb_bak___ and ___jb_old___ files in PyCharm

When I got some PyCharm project from my colleague I saw some backup files of *.py files.
This files have types: *.___jb_old___ and *.___jb_bak___.
I open the files in Notepad++ and see that these are identical backup files of the corresponding *.py files.
I asked my colleague, but he didn't know what these are.
Why are there TWO identical backup files for each *.py file?
How can I tune PyCharm? We want to turn off this backup.
Google gave me nothing :(
You can disable "safe write"
Use "safe write" (save changes to a temporary file first) If this
check box is selected, a changed file will be first saved to a
temporary file; if the save operation is completed successfully, the
original file is deleted, and the temporary file is renamed.
https://www.jetbrains.com/webstorm/help/system-settings.html
i had this problem in webstorm when a script file was running and i was editing it in webstorm. when i stopped the script and edited it everything was fine
it's a temporary file used by PyCharm to make sure you change will not be lost when editing files. it's safe to delete them manually, you will only loss very recent changes. IntelliJ IDEA works the same as PyCharm.
How to delete them?
To delete a file on a file system requires two things: 1)you have the permission. 2)no program is using it.
so make sure you have 'w' the permission, and stop all program which is using it. then you can remove it.
How to know which program is using it?
Normally you should already know it. but sometimes some background programs(like crash plan, google drive sync, e.g.) may also hold it quietly, then find and kill all programs may be very tricky. the easiest way is reboot your computer with 'safe mode', in which only the OS kernel is loaded.
I spend two hours to figure out the reason why I cannot delete the temp file even when I have whole permission. a crash plan service is holding it in background. This may not be your issue, but if you cannot delete the temp file, this will save your time.
While JeremyWeir's solution probably does work, the real fix - imo - is to enable write permission on the directory.
Saving a file would only need write permission to that file itself. But with the "safe write", you need permission to create the file and rename it - which means you need write access to the directory.
In Linux this would be e.g. chmod ug+w DIR, if you want to give write access to user and group.
I have exact same issue with PhpStorm after system crash. The fix I found was to manualy delete *._jb_old_ and *._jb_bak_ files and reinstall PhpStorm

SSIS File System Task Deleting Directory Leaves Directory and Removes all Permissions

I have a rather bizarre issue with an SSIS package I have. After processing some files within a Directory I am removing the Directory so my For Each Loop doesn't process the same files again.
It fails to Delete the Directory but yet leaves it in the folder and then tells me I do not have access to this folder, I cannot take ownership of it or even move it to another directory.
I have even tried a VB.NET Script tasks to try and remove it and I get the same result.
A reboot of the server makes the folder disappear - has anyone experienced this before.
Regards,
JML
Sounds like the directory is "in use" still but with the deletion pending. When you reboot, the lock on the directory is cleared and the deletion completes. The discussion at
try ing to move a file "The process cannot access the file because it is being used by another process."
may be helpful.