ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a script that finds and reads and processes a "saved as" Firefox file then deletes it and wait for a new "saved as" file of the same name but although the old file has been effectively "deleted" (its name is not there anymore in "ls" before getting the new file), the script then processes the contents of the old file, not the contents of the new file and no matter of how many times this new file is changed. I suspect it is fetching the old original file contents of the same old file from a cache somewhere (since the name is not changed).
Could someone make suggestions (clear cache or use command more appropriate than "rm" or another browser)?
a man walks in to the doctors office, and says, hey Doc. I got a freind that every time he stands up, his pants falls down. What do you think is the matter with him?
Doc: Maybe he needs a new belt.
Friend: but he has no hips to keep the belt up.
gee I wish I had something to look at so I could tell what is really going on.
If you edit a file and want to save the revised version by replacing the original, you should use the SAVE button. The original file will be replaced by the revised version.
If you want to save the revised version with a different file name, you should use the SAVE AS button, and (when prompted) give the name for the new file. The original file will remain as it was.
Your post prompts the thought that you are using the wrong button and Firefox is operating correctly.
Your post prompts the thought that you are using the wrong button and Firefox is operating correctly.
The file is saved "as is" and then the "saved" file (its copy) is read by script and processed, not the original but Firefox does not offer a "save" option in this case, only a "save as" option. After processing, the "saved as" file (not the original) is removed (rm) and Firefox is closed. Finding the file is done by using "find newer.." than a dummy file just "touched" by the script for that purpose. After a certain time, the problem automatically disappears - for example waiting long enough between the processing of 2 different files by the same instance of the script which seems to support my view that a cache is involved.
Checked and files are properly open and closed at the appropriate time (just before and after reading/writing), I was expecting an obvious trick, not having much experience dealing with browser files, it is not the case. The script is over 900 lines of code, posting it will be too much for the volunteers to investigate and posting the relevant code will always leave the doubt there is something else of importance not showing. I am also limited with time and found the easy solution is to give the files a different name/extension (.001 etc) which works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.