Copy and Paste Files without FileUtil - file

After browsing on the internet, I have discovered that the Free Pascal compiler Lazarus has a few issues with using the unit "FileUtil", which has the procedures that I need to copy and paste files.
So I thought that I could write procedure(s) that would do it for me. I need the procedure(s) to select a file (of any kind, text, image, etc), to create a copy of the file (With a name like "FileName(Copy)"), and to place the copied file in a hard-coded folder, such as "\test". I'm having a bit of trouble, can anybody help out with code or even another library that can do the same as FileUtil?
I'm open to ideas as my previous attempts have crashed and burned. Thanks a lot in advance!

Related

Update file across multiple folder locations?

I need something that can copy a specified file any and everywhere on my drive (or computer) where that file already exists; i.e. update a file. I tried to search this site, in case I'm not the first, and found this:
CMD command line: copy file to multiple locations at the same time
But not quite the same.
Example:
Say I have a file called CurrentList.txt, and I have copies of it all over my hard drive.  But then I change it and I want all the copies to update.  So I want to copy the newer one over all the others.  It could 'copy if newer', but generally I know it's newer, so it could also just find every instance and copy over it.
I was originally going to use some kind of .bat file that would have to iterate over every folder seeking the file in question, but my batch file programming is limited/rusty.  Then I looked to see if xcopy could do it, but I don't think so...
For how I will use it most, I generally know where those files are going to be, so it actually might be as good or better if I could specify it to (using example), "copy CurrentList.txt, overwriting all other copies wherever found in the C:\Lists folder and all subfolders".
I would really like to be able to have it in a context menu, so I could (from a file explorer) right click on a file or selected files and choose the option to distribute it.
Thanks in advance for any ideas.
Use the "replace" command...
replace CurrentList.txt C:\Lists /s

Reconstruct odt file with missing content.xml file

I have an .odt file that's corrupt. I looked online and apparently if you can get to the content.xml file, there's a chance the file can be repaired. However, in my case, when I convert the file to a .zip and extract it, I don't have that file. However, the .odt file is 2.9MB and has content in it when you convert it to a .txt file.
How can I recreate the content.xml file from the .txt file?
You might not want to hear this, but depending on where the corruption happened, there is nothing you can do.
The idea behind the method you are describing is that if the corruption only concerns, for example, the styles.xml, you can still recover the contents by looking at content.xml. For more details on this, see https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Format_internals
However, from your zip extract, it looks like the only uncorrupted file is styles.xml, which doesn't help you much.
What you can try to do is the following: Rename your .odt-File so that it ends in .zip, and then try to recover that file using one of the multitude of tools available on the internet, for example here, until you get a valid content.xml file.

How do I search into an .exe file to recall a file in batch

This may seem a bit ironic, but I am currently working on a 250$ kit, and I hoped to program in batch. (It's a long story, alright?) HOWEVER, I want to compile my source code into an exe, but because it has so many dependencies, and I mean a lot, (At the very least, minimum dependencies is 4 without having someone create more), and I'd like to modify ONE of them and run the other two(If it helps, it is a text document, and three cmd files) while running the program, is there a way I can add these into the primary .exe file and have the .exe file(PROGRAMMED IN BATCH) read, run, and modify the files I add in, or do I have to leave them separated? Basically: Bootstrap as the executable, a screen.cmd and backlogger, and then a .txt file. It's... complicated on how to explain it. (Sorry if I may seem a little off hand, I've got issues attempting to keep myself on one track most of the time)

How to get file name when file change is observed via watch_file

I am currently facing an issue which I don't know how to fix. I got the following Julia code:
while true
print(watch_file("test"))
end
So this should get me all the file changes in the directory named "test". At least on windows.
Now thats all well and good, and it kinda works, at least for creating a file or moving a file to that directory. This is an example of what I get:
("New Textfile.txt",Base.FileEvent(true,false,false))
But when I delete or rename that file, I don't get the filename of the file deleted or renamed.
("",Base.FileEvent(true,false,false))
Is there a different method/function I can get the filename with, even when the file is deleted or renamed? Or even better, a way that archives this and is cross-platform-compatible? Any help appreciated.
EDIT: If you could give me an alternative that supports recursive monitoring, that would be even better.
In Linux, Julia 0.4.5 and 0.4.3 watch_file returns file name always. It is a very platform-dependent feature (like in Node.js https://nodejs.org/api/fs.html#fs_caveats) and only manual polling can be truly platform-independent solution.

What is the *.cf7 file extension?

At work we have been given a .cf7 file from a client and been expected to know how to access it's contents. We suspect it is some sort of database or accounting records file, most probably propriety, as it was contained in a folder called "books and records".
Has anyone dealt with .cf7 files before? Does anyone know how to use one such file? Opening it in a text editor reveals it is of a binary nature. Any pointers would be greatly appreciated.
Thanks!
Try a product called Cashflow Manager. It also uses the .cf7 extension.

Resources