Dealing with SVN Renames for an file sync tool (like Dropbox) - windows

I'm working on a simple file sync tool for Windows that works like Dropbox but uses SVN. (I might open source it, it's just toy right not but it works really well.)
PROBLEM: Renaming a file... I can catch the event from the Windows OS with the old name and new name. But how can I register the rename in SVN without actually doing it in the file system?
I know SVN doesn't support that, but I want thinking of some other way. For example a rename is just a copy and a delete.
For example, I could do a server side copy but then the local copy is unversioned. There's got to be a way! Any ideas!?
[And deleting all the old files and reuploading them with new file names doesn't count ;) ]

See how EasySVN deals with it. It is an open source file sync tool for Windows & Mac OS X, with autocommit, based on Subversion.

Related

Cannot run Xcode project when copy from pc

I want to copy the xcode project I saved in my pc to my Mac but I can't open it.
All the files in that project was added "._" in the their name.
How can I fix this? I don't have this project on my Mac anymore, only on pc.
Those ._-files contain the extra file attributes that might not be available on other file systems. Typically you get them when you copy a file from your Mac to a file system that does not support extended attributes (like an USB flash drive with FAT). Therefore I expect that those ._ files alreday exist on your PC.
You should be able to simply delete them without any inconvenience; alternatively, you can use the tool dot_clean to merge them back.

VB.NET file has become an unreadable format

So the images below were originally a vb files. I have just opened it and it looks like this and the compiler won't run it. I am unsure whether this is a compiler error or whether it may have become corrupt because the project is stored on an external drive. It is just these two forms that have broken like this; I have one other form and a module in the same project that are okay but the project can't run because of the two that are broke.
Broken Login Form
Broken Diary Form
If it changes anything, the designer files for the forms are intact it is just the scripting for the forms elements that is broken.
Also, if I can't identify the cause, is there a way to revert it back to the last working version in visual studio to get my code back? Just because I put a lot of time into it.
The data in those files is most likely gone.
IMPORTANT: Do not write anything to that disk drive unless you find that you cannot recover those files.
If you are using a version control system then you can revert to an earlier version.
If you are using Windows 10 and you happen to have stored those files in a location included in what File History saves, you can recover them from that.
If you use some other form of backup, retrieve the files from that.
If you have a separate disk drive with at least as much free space as the one with the corrupted files, you could try running file recovery software as it might be that the zeroed-out file was written to a different place on the HDD.
TinTnMn pointed out in a comment that if you previously compiled the code, you should have executable files in the "obj" and "bin" folders that can be decompiled to recover most of your work
It could be quicker to re-write the code while it is still fresh in your mind.

Visual Studio - File changes not saved to original disk location?

Ok, complete Visual Studio & Windows development noob here - there's gotta be an easy answer to this.
I've just started working on porting a Linux C++ library to Windows. Existing source tree is on the Linux file system, VS is running in a Windows 7 VM, which has the Linux file system mounted.
I added the source tree to a new project - I was initially doing the edits on the linux side, but now I've done a few from the VS IDE. But those edits aren't showing up on the disk?? I've done the typical save: ctrl-s, done the "save all": ctrl-shift-s, saved from the menu, etc. If I look at the file on the disk on the linux side, the changes aren't there.
I've shut down & restarted VS, and it still sees the changes on restart. How do I get the changes back on the actual disk so I can commit to subversion, etc.?
I've confirmed that the files & file system are read/writable from the Windows VM.
I'm sure this made sense to somebody, but I'll be damned if I get it.
Visual Studio Professional 2013 on Windows 7
You shouldn't be reading/writing to the same directory under both environments, imo. Not the least reasons of which is that *nix & windows have different ideas of line endings.
It would be much better to keep a git repository on your host OS (or on a server like github) and pull/push to that repo from your windows VM. Git is smart enough to handle all the line endings, symbolic links, permissions, etc. automagically.
I have seen similar behavior using BC++ IDE.
In my case I was trying to edit files that were hard links to files in a second directory (on the same NTFS file system).
The IDE is using some mechanism to reposition the file to be edited into the _history backup directory.
I.e. the editor unlinks the original file in the original directory and relinks it in the _history subdirectory and creates a completely new directory entry for the edited file.
The hard linked file I created in the second directory is thus then linked to the backup file in the _history directory so when I edit the file in the second directory with notepad, the modifications appear in the _history backup file (or vica versa) but not the file in the originial location.
Its not like a simple text editor (notepad) where the edited file is opened-read-closed and when saved, reopen-written-closed using the same directory entry.
I presume that the IDE is using a low level Windows file system function to rename/link the original file into the _history
directory and that this mechanism does not support/recognize NTFS hard links. I suspect in your case that VS may use a similar relinking mechanism (specific to NTFS) that similarly would not work with the files in the mounted Linux file system.
That VS may be storing edits in a temporary file (may be hidden or in some other temporary directory) so the original file is not lost if the IDE crashes. When the file save is committed it attempts to link the original file to backup and then attempts to relink the temporary edit file into the original directory entry location, but because the NTFS file system linking mechanism is not compatible with the Linux file system, nothing happens.
[I do observe temporary files appear like this when editing MicroSoft Office documents. notepad++ also does this, so I suspect VS is doing the same thing.]

Watch a folder constantly for new files

I have a web folder on a Mac (running MAMP Pro) and have files been added within it on the fly, whose URL is as follows .
http://abc.com/folder/
I have another Windows machine that should constantly watch this folder and download any new file that gets dumped to this web folder to c:\macfolder\ (The files are always tsv's).
I know I can use wget to acquire files and run whatever program that would do this as a scheduler in windows to watch constantly, but whats the best way to watch this folder for the new files.
Thanks
P.S I do not know what are the best tags for this question. Help me out with that too.. :P
Since the directory already is mounted on Windows, your question appears to be a duplicate of this (and related) - assuming you're OK using C# to build such a tool:
Monitoring a directory for new file creation without FileSystemWatcher
If not so keen on the C# tool, there are command line solutions like this one here:
batch file to monitor additions to download folder

Is there a sensible way to backup Visual Studio C++ solutions without all the "extra" files the IDE creates?

I would like to make a backup of my project, but the folder now exceeds 6.6 GB mainly through extra libraries like boost etc, but even if I just select the folders with my sources, I end up with big files like: .ipch, .sdf and potentially others. To make matters worse I use eclipse to code and VS to compile, so that adds to the mess, although I have the impression that only VS creates big files.
In case shit hits the fan I would like to be able to unpack one archive, and have everything in there like the project settings and solution files, and the sources so that I can easily open it again in VS. I can live with having to re-download boost or other third party libs.
How do you tackle this problem and do I need to preserve file like .sdf?
Answer:
Thanks for all the tips. I will now adopt the solution proposed by LocustHorde because that seems to fit my needs best. I simply want one file that I can take offsite as a safe backup (and I don't want to use an online service). Storing all versions of all files doesn't seem to work towards smaller and simpler and it would be a bit overkill in this case, although I will look to install some version control system because I have no experience with them and I would like to get some...
Final Answer
After having a good look I found that dishing out which files had to be ignored by the winrar archiving was still a hassle. I finally ended up installing Git out of curiosity and liked it. So I now have some of my projects in a local repository. From eclipse I can easily mark files and directories for being ignored, and to make a backup I use git-extensions to clone the repo. I still need to look at purging old versions, which isn't very userfriendly in Git, but seems to be possible at least and then i will just 7zip the folder up. In the worst case I just delete the git database and I just have the last version of my source files. Or maybe I can checkout to another directory. We'll see.
First: Instead of doing a backup, I would strongly recommend using a version control system (VCS) like Subversion, Mercurial, or Git. This is the professional equivalent of a backup, except it maintains every version of every file—not just a copy of the latest version.
Even with a VCS, you will still need to decide which files to check-in to the VCS, and you don’t want to back up files that can be easily re-generated.
For my projects, I generally don’t check-in:
Generated executables (the output in the Release, Debug, x64\Release, and x64\Debug directories).
Pre-compiled headers (the ipch folder)
The browsing database (sdf files)
All of these things can be re-generated by rebuilding your project. If you are working as part of a team, you probably shouldn’t check in:
Your personal settings (.suo)
You can always re-create this if needed.
A particularly nice way to backup your stuff is to put your source in a revision control system. I am using git sometimes, and other times mercurial. Using git I can ignore the files that should not be backed up, by adding them to .gitignore:
Debug
Yokto.sdf
Yokto.suo
*.filters
*.user
ipch
Release
Yokto.opensdf
*.opensdf
*.sdf
With git I can set up a backup repository on a network drive and simply push to it every now and then.
you can write a simple script (batch file) that only zips the types of files you want. suppose, you want to zip all your .aspx, .cs, .config, .xsd files only,
suppose you have winrar installed in your c:\program files\winrar
and your project is in c:\project\MyBigProject
then, just open your notepad, copy paste this, and save as "script.bat" (dont forget the double quotes while saving, you need to save it with double quotes, so that notepad saves as .bat extention instead of .txt)
so to backup (in other words, to zip wanted files) :
"C:\Program Files\WinRAR\rar" a -r0 -ed MyBackup.rar c:\project\MyBigProject\*.aspx,*.cs,*.xsd,*.config
the syntax is like this:
"path to winrar folder" 'switches' "Name of completed rar file" 'folder to zip'
just make sure the paths are in proper order. the "a -r0 -ed" parts are switches, and you can find out all about the switches here:
http://acritum.com/winrar/manual/index.html?html_helpswitches.htm
I use the "Ignore files" switch (http://acritum.com/winrar/manual/index.html?html_helpswxa.htm) to ignore all files and folders that I dont want (with wildcards) and My project is about 86 mb, when It gets compressed just with code files, it comes up to 6mb.
its the best way to do it really. If you need more help, please ask!
edit: Also, Look into SVN (its free!) - I use svn too, and its really helpfull. there is even a free tool called AnkhSvn to integrate into visual studio. its just fantastic!
Doing a "clean" before archiving removes most of what you don't need.
Edited to add:
Of course a version control system is essential for any ongoing project, but that's not what he's asking.

Resources