How to see when your file has been renamed - windows

I have made a project that renames files using FTP. Now I want to find out which files have not been renamed. I could find it out by looking up those files using the file structure (It is different after the rename), but I want to know if there is a more easy option, like using the "date modified" from windows. (date modified does only work if the file itself has changed, not the name)

In accordance with file systems, former filenames are not recorded unlike the last modification date, therefore there is no easy way to find it out. You should implement your own mechanism to accomplish this.

Related

Warn user for creating file with same filename in same directory but also include sub directories

I'm looking for a solution that checks for the same filename when I'm downloading files, specifically through Firefox on Windows 10. I know that this feature comes standard when it comes to files in the same directory, but as the volume of files scales up, it's getting harder and harder to find what I'm looking for out of the files I've downloaded.
But since Firefox doesn't have an option to scan sub directories when saving files (nor can I find an add-on for Firefox that does something like it), I'm looking for any alternative solutions that would achieve what I'm looking for in the end: something that will notify me that I'm attempting to download (or have just downloaded) a file whose name already exists in the sub directory of a given folder, whether that be via an add-on, or some kind of application or script that can run in the background. Preferably, I would like it to check the folders inside of those sub folders as well.
My memory is terrible, so I opted to keep everything in the same folder so I would immediately get the warning when attempting to download a file I'd already downloaded. But said folder now contains far too many files for me to realistically glean through to find a particular file that I'm looking for.
I would like to be able to sort these files into sub folders of the folder I'm currently storing my downloaded files while keeping the functionality of being able to immediately tell whether or not I'm about to download something I've already downloaded. All I need is a check to see if the same filename exists upon trying to create a file (which is already a feature) - but in the sub directories as well. I do not need any functionality to actually view all the files in each sub folder in the same window.

What's the proper way to overwrite system/hidden files with Windows API?

When you copy files using CopyFileExA function (see Windows API Reference: winbase.h) it has the ability to "fail" or not, if the destination file already exist, using (or clearing) the flag COPY_FILE_FAIL_IF_EXISTS. However, I can not find the way to overwrite files with attributes Read Only, Hidden or System.
I am working on a backup program with specific requirements which I can't find anywhere else.
I was thinking that before copying a file with one or more of those attributes set, perhaps I could clear those attributes on an existing file and then proceed to copy the file, knowing that my program will overwrite existing file with clear attributes.
Is that the best approach?
Another option would be just delete the old file before copying a new one. But I'm afraid that if I delete the old (backup) file and only then will try to copy the new one AND if the copy for some reason fails, then I will ended up without a backup file.
Or maybe there's a way of overwriting System/Hidden files that I'm not aware of.
What would be the best method of accomplishing this - copy and overwriting files with System/Hidden/ReadOnly attributes set?

Windows - Virtually consolidating files from several directories into a single path

I have been searching for this for a while but no success yet. Not sure if I'm using the right terms...
I'm trying to programmatically automatize the use of an API (from a software called Pix4D) to which I need to pass a directory path as one of the parameters. This directory is supposed to contain all files that will be processed by the aforementioned API.
The problem is that the API only accepts a single path, while my business process will always organise the input files into several input folders (I tried, but I cannot change this).
I'm trying to find a way to create an extra folder that would contain some sort of reference to all the files organised in those input folders. Thus, when one opens that "virtual folder" path, he would see all files together. This would potentially allow me to use the path for the new folder as the input for the API.
So, suppose I have these files I want the API to process:
C:\proc\20170101\f1.jpg
C:\proc\20170101\f2.jpg
C:\proc\20170201\f1.jpg
C:\proc\20170201\f2.jpg
C:\proc\20170301\f1.jpg
C:\proc\20170301\f2.jpg
I would need a single path to a directory that virtually contains all those 6 jpg files.
Some constraints:
We don't want to duplicate files
The virtual path needs to be created via command line
It should work on a Windows machine
Yes, there might be files with same names in the input folders. We can work around this, if necessary
Open source/free solutions would be better
Any help is highly appreciated. Same goes to any different approach to the problem.
Thanks

TortoiseSVN - Add Prefix to all Files in a Directory without needing to Specify each Filename

I'm hoping that this is in the right spot.
Basically, I have a set of files which are versioned in an SVN repository, and I am using TortoiseSVN. These files all need to be renamed so that their new name is equal to their current name, plus a prefix added to the front.
Tortoise has the ability to rename the files, but it must be done manually, file by file, through a GUI menu, and I would prefer a less tedious and less time-consuming solution.
I have seen on this site examples which use Windows-based solutions, but I do not expect these to work, as they would not change the filename through TortoiseSVN but through Explorer, which would cause TortoiseSVN to not recognize those files as being equivalent to the originals, even if we recognized them as such.
I saw another question, linked here: (tortoise svn mass rename files merge)
In which the asker says that the files were renamed with a windows tool and thus SVN did not recognize them, and the solution offered was to write a new script which would pick up the old name, replace it with the new name, and repeat for each entry. However, unless I'm misreading it, that solution would require going in and specifying the old and new name for every entry, which from my perspective could be just as time-consuming as doing the manual option in TortoiseSVN.
I considered another possibility in that I could use windows command line to make a copy of every file in the directory, renaming the copies to fit. Then I would SVN delete the old files and SVN add the new files. This would achieve the rename, but then the history association would be disrupted, as it was technically no longer the same file.
The problem I'm running into as I read different questions asking similar queries is that they seem to be built around specifying the start file name and the end file name for each entry. I want to do a blanket rename on every file, without needing to consider the file name before or after the execution.
As such, my investigation has brought me to ask this question: Given a set of known existing Files F, and a known, constant prefix P, can TortoiseSVN be made to automatically update every entry in F with the prefix P, but in a way that TortoiseSVN recognizes as its internal 'rename' process (rather than an exterior process which would, in its perspective, replace, rather than change, the given file), and without having to also define the resultant end name of each file in F (thus no need to specify old and new filename for every entry), so that each file can be updated without needing manual intervention for each one? Thank you for reading.

How can I create a file with invalid Windows timestamps?

I'd like to create a file with an invalid created/modified/accessed timestamp to use in unit tests to ensure that my application can handle files with invalid timestamps. It's a Windows application written in C# that could run on both NTFS and FAT32 filesystems.
This is not possible.
If you are looking for a timestamp editor, I found this one useful.
http://code.google.com/p/stexbar/
Have a look at the opensource 'Touch for Windows'.
It updates the dates associated with a file to whatever you want it to be. It can change access, modification and creation dates. You as a user can update them independently of each other, you can update them with any possible date. Dates can be now, user specified or copied from another file. If you try to touch a file which does not exist, this command will create it for you (empty of course).
Have a look and download the source here.
Get the NuGet package MySql.Data in version 8.0.18 ( from here).
On my NTFS filesystem, this little dll acts a bit weird.

Resources