What is a good way to copy all files in a folder to another one? I don't want to copy the whole folder, just all it's content.
More precise, I want to move all files and folders in a folder one folder up. Example: I want all files and folders in \myfolder\data\ moved to \myfolder\.
What would be an easy way to do that?
Related
Is there an efficient alternative method preferably using WinRar on Windows 10 to extract selected files and folders from a single zip archive into multiple destination folders simultaneously, instead of one operation at a time?
I was sure the 'extract one to many' concept would exist in the software, but nothing is mentioned in the Help facility on how to select multiple destination folders.
Thank you.
I normally open the archive (using WinRar in Windows 10 Home), select all the file and folder content from within the parent folder but not the parent itself (using SELECT A ) and then use 'EXTRACT TO' to navigate and select the destination folder.
Once the archive has been unzipped and overwritten any existing files and folders, I then repeat the process manually, about 10-15 times to extract everything still previously selected into several more unique destination folders until completed.
I would like to be able to select the multiple destination folders in one go, making multiple copies simultaneously.
I want to have a "virtual" filesystem like OverlayFS where I can rename the files and folders, but without copying the whole file. I have an archive with over 800TB of Data and the files need to be renamed, but I want to keep the original folder structure and the filenames.
For instance:
I have the 800tb mount on /mnt/archive.
I want an "overlay" mount on /mnt/archive_renamed.
So that a file, for example Data001.bin on /mnt/archive can be renamed on the overlaymount and look something like this /mnt/archive_renamed/Data_from_2014/Data_from_Cats.bin but belongs still to Data001.bin and never touches the underlying mount.
OverlayFS would be perfect if it doesn't need to copy the whole file when renaming it.
Any clue?
In /mnt/archive_renamed, you can use hardlinks to the original files.
Just do "cp -al /mnt/archive /mnt/archive_renamed" and you'll have to folders pointing to the same files.
I'm currently trying to compile a large project, which has a lot of folders with a lot of subdirs and subfiles.
These files all need to be in the right folder with the right name.
In the main folder where also the .py file is, are 2 folders with all the files.
The problem is:
I need to add all these in the .exe file. These are Like 170MB, So adding them all per hand is not an option.
It is also important that everything is in one .exe file. Does anyone know how to do this?
I've been trying to copy files from one directory to another and then changing all the files I moved into .txt files. The only problem is that there are multiple, probably 30+ different extensions and hard coding them is not an option because there could be different extensions in different output folders. I've been able to move all the files from one to another pretty easily, but being able to change every extension in a folder (.ser, .pbr, etc,) to a .txt has proven difficult. If anyone could help that would be great. This is my code for moving files from one folder to another so I just need to be able to change the files to .txt either while they are being moved or after they've been copied to the new folder.
src = 'L:/Development/DCS/UL/Dev\202209\1_202206_4355_4359/OUTPUT/202112'
trg = 'L:/Development/DCS/UL/Dev/Test Output'
files=os.listdir('L:/Development/DCS/UL/Dev/202209/1_202206_4355_4359/OUTPUT/202112')
# iterating over all the files in
# the source directory
for fname in files:
try:
# copying the files to the
# destination directory
shutil.copy2(os.path.join('L:/Development/DCS/UL/Dev/202209/1_202206_4355_4359/OUTPUT/202112',fname), 'L:/Development/DCS/UL/Dev/Test Output')
except:
print ("error")
pass
Does anybody know of any way (on Windows) to create an archive (zip, rar,..) and adding files to it by importing a list of files to be added (say from a CSV or text file or simply pasted) that need to be archived. Say I have a simple list of 1,000 files across multiple directories that I want to add to an archive, this would be a much simpler method of doing it than adding each file individually. Also I do not want to arhive the entire directory as it is absolutely massive.
eg:
c:\somedir\file1.php
c:\somedir\somesubdir\file2.php
c:\someotherdir\file3.php
...
And no I do not want to import all files in certain directories, the hundreds of files are scattered across tens of directories which also contain lots of other files that I do not want to archive.
Thanks
rar.exe from WinRAR has the following option:
n#<list> Include files listed in specified list file