vscode: changing a file modifies it in temp folder, I cannot make changes to files outside of the temp folder - visual-studio-code

I have a file built by somebody else. I am trying to append lines to the end of it.
When I do this and hit save, everything seems to work. But the only change has been in the temp folder, which seems to be a copy of my real folder. No changes occur to the actual file. This means that I cannot do development in vscode, since I cannot actually modify files.
How can I fix this?

Related

Can I configure VSCode to auto copy my file to another file whenever I save?

I am new to VSCode. Is there a way VSCode can auto save all my saves to a sequence of files? For example, my file is named foo.c, after some editing, the first time I save the file, there is a file foo.c_1 generated, the 2nd time foo.c_2, the 3rd foo.c_3, etc.
savevers.vim is what I have been using for vim. It is super convenient, say, when I want to retrieve a version I did the day before.
[Update] Yes, thanks life888888, timeline works great, it saves the history after I close and reopen the project folder.

Changing files while copying and pasting them

What happens if i copy and paste a folder with lots of files and i change a few ones (from the source) while the files are being copied? Will the files be copied with new changes or the previous? Or depends on the OS? I use Windows 10 Education
It depends on when you make the change. Each file is read and written to the new location one at a time. If your file is copied before the changes are saved to disk, the changes will not be copied.
You can actually test this by saving changes to a file before/after that file appears in the new directory. If it has already been copied, it will not be updated at the end of the copy. For more advanced behaviors, you can try using something like xcopy or robocopy.
If you are cutting and pasting or dragging and dropping a file, your changes will come with you since the location of the data on the disk never actually changes. In this instance, many programs will notify you that the file you were working on was deleted/removed.

Robocopy a specific folder

We use a folder template for our projects we work on and my normal process to log each job is to right click, copy, rename, make shortcuts, etc... It's like a 5 minute process after everything is said and done. For right now the idea is to just copy that template folder, rename, make shortcuts, and send those shortcuts to the appropriate directories. This issue I'm having is that when I run robocopy it is copying the contents and not the template directory itself. A snippet of what I have right now is:
robocopy \\Users\blah\blah\DirectoryIWantToCopy \\Users\blah\blah\CopiedDirectory /e
As of right now when I run it, it is copying everything inside the directory instead of just copying the parent directory. I understand why it's doing it, but it seems as though the only way to accomplish what I'm doing is to exclude all the directories inside \Users\blah\blah\ that I don't want it to copy. Is there not a switch to add that just says copy this specific directory and all sub directories of this specific directory? I'm sure that is as simple as it sounds, and I'm sure I'm overlooking it, but from all the other questions I've googled I haven't been able to find an answer that answers this.
So when I read the information about the switches on Technet it kept referencing a file, and thought that only meant an actual file and not a directory. I got it to work by simply adding the file name after the destination. Thanks.

Correct way to copy Swift project without altering old project?

I was wondering if there was a correct way to make a copy of a Swift project?
I realised that when I want to make a copy of a project (so that I can have a backup working copy when I continue with my project and I make a mistake) and I use that copy; the copy alters the build folder of my original file. Not only that but if I re-name classes or change IBLabels/IBOutlets, and although the change isn't reflected in the original code; when I compile the original file there will an error associated to an undefined class or the xib file would be changed which would also throw an error. At the start the original file compiled, but after working on the copy of the original file and running into an error. The original file also wouldn't compile, any ideas on why this happens? And how to fix it?
Though #Daij-Djan's answer is correct you need to watch for added files with relative paths. So what I do for a backup is to use git. That works better than any backup.
If you really want a copy, just copy the folder with the project with CMD-D which creates a <folder> Copy (or whatever is your localization). You can rename the copy, but leave the contents untouched. Also do leave it in the same folder as the original one to avoid conflicts with relative paths.
Just copy the whole folder from a to b!
IF you used absolute paths in your xcode project though .. bad for you :/ your project references the original files no matter what
what you can try is fixing the project.pbxproj xml file manually. this is doable but not supported by xcode really :/
IMHO if a copy isn't enough because you messed up the project with absolute paths, readd all files MANUALLY and make sure all is relative to the project location
Just zip your current project & extract it inside your new project folder & enjoy....

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.