Copying files as zero byte files
Copying files as zero byte files
This is what I'd like to do:
- Copy files or a directory structure with files.
- The target files should all be zero byte files.
- Target directory structure and target file names should be identical.
Is this possible?
Is there a mask for this?
Thanks for any help in advance!
- Copy files or a directory structure with files.
- The target files should all be zero byte files.
- Target directory structure and target file names should be identical.
Is this possible?
Is there a mask for this?
Thanks for any help in advance!
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Copying files as zero byte files
This is a small complication, but we can get over it.Tim wrote:- The target files should all be zero byte files.
1) Copy your directory using the Copy (F5) command
2) Go to the target directory, open Find window (Alt+F7), and find all files
3) In the Find window select all found files (Ctrl+A)
4) Open User Menu (F9) and choose your prepared command TRIM.
How to prepare the TRIM command:
1) Create a zero file in your working directory (C:\Work\zero.txt)
2) Options > Configuration > User Menu
3) Insert a new command TRIM, please look at following screenshot.
Dear Jan,
Thank you very much indeed.
Děkuju!
What a quick and professional support. Amazing.
Works like a charm!
(If you find the time.... Could you explain what actually happens? So far it seems like magic. I assume that every file is overwritten with the contents of the file zero.txt. Correct? Is it normal that the file zero.txt exists in every directory after the operation is carried out?)
Best wishes
Tim
Thank you very much indeed.
Děkuju!
What a quick and professional support. Amazing.
Works like a charm!
(If you find the time.... Could you explain what actually happens? So far it seems like magic. I assume that every file is overwritten with the contents of the file zero.txt. Correct? Is it normal that the file zero.txt exists in every directory after the operation is carried out?)
Best wishes
Tim
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Strange.Tim wrote:There's still a file called zero.txt in every directory.
Please try to clear Options > Configuration > User Menu > TRIM > Close shell window option.
After TRIM command will be executed, the command shell should stay on your desktop. Could you please show me the output (use copy&pase from command shell window)?
It should look like this:
D:\testdir>call copy "c:\work\zero.txt" "test2.txt"
1 file(s) copied.
D:\testdir\dir>call copy "c:\work\zero.txt" "test1.txt"
1 file(s) copied.
D:\testdir\dir>
Re: Copying files as zero byte files
I sometimes need copy of the directory structure too, but without files. I am just curious here: Why you need it including zero lenght files?Tim wrote:This is what I'd like to do:
- Copy files or a directory structure with files.
- The target files should all be zero byte files.
- Target directory structure and target file names should be identical.
Is this possible?
Is there a mask for this?
Thanks for any help in advance!
Re: Copying files as zero byte files
And what about, if you have need preserve original time stamps of zeroed files?Jan Rysavy wrote:This is a small complication, but we can get over it.Tim wrote:- The target files should all be zero byte files.
1) Copy your directory using the Copy (F5) command
2) Go to the target directory, open Find window (Alt+F7), and find all files
3) In the Find window select all found files (Ctrl+A)
4) Open User Menu (F9) and choose your prepared command TRIM.
How to prepare the TRIM command:
1) Create a zero file in your working directory (C:\Work\zero.txt)
2) Options > Configuration > User Menu
3) Insert a new command TRIM, please look at following screenshot.
...
Do you have any idea?
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Copying files as zero byte files
Please look at http://forum.altap.cz/viewtopic.php?t=149jis wrote:I sometimes need copy of the directory structure too, but without files.
Re: Copying files as zero byte files
Thanks, it works very well, but why pass thru the exclusion mask |* just only folders, not any files? Any logical explanation?Jan Rysavy wrote:Please look at http://forum.altap.cz/viewtopic.php?t=149jis wrote:I sometimes need copy of the directory structure too, but without files.
Altap Salamander fan since 1998
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Copying files as zero byte files
I thought, you need copy directory structure only? The |* is used to filter files out.jis wrote:Thanks, it works very well, but why pass thru the exclusion mask |* just only folders, not any files? Any logical explanation?
-
- ALTAP Staff
- Posts: 5231
- Joined: 08 Dec 2005, 06:34
- Location: Novy Bor, Czech Republic
- Contact:
Re: Copying files as zero byte files
No idea under Windows command shell. In UNIX shell it will be piece of cake.jis wrote:And what about, if you have need preserve original time stamps of zeroed files?
Do you have any idea?
Under Windows I would make a small command line application for this task: take a filename as parameter, truncate it, preserve date/time/attributes.
Re: Copying files as zero byte files
Oh Jan, you misunderstand meJan Rysavy wrote:I thought, you need copy directory structure only? The |* is used to filter files out.jis wrote:Thanks, it works very well, but why pass thru the exclusion mask |* just only folders, not any files? Any logical explanation?
I was too brief in my question...
Sorry for this.
I learned about |* mask from this great forum and I started using this mask to filter out files and to copy only folders in my workflow just before this thread started.
Before I learn this trick I use my own script for cloning selected directory structure without files:
Code: Select all
xcopy.exe "$(Name)" "$(FullPath).Clonned directory structure" /t /e /y
Altap Salamander fan since 1998