rejetto forum

Unable to archive/download all

Kiego · 9 · 11071

0 Members and 1 Guest are viewing this topic.

Offline Kiego

  • Occasional poster
  • *
    • Posts: 6
    • View Profile
Hi,

I am using the HFS version 2.3m build#300. I have a folder with many text files which are constantly have data appending to the files by other application. When I try to select multiple of these files and press archive from my Chrome browser. Not all the files selected are archived in my .tar file. I had tried other browser and the result is the same. Is there anyway I am able to have all the files selection to be archived in my .tar file?


Offline NaitLee

  • Tireless poster
  • ****
    • Posts: 203
  • Computer-brain boy
    • View Profile
In an operating system, when a file is opened and changing, other programs cannot see changes, or cannot even access it.
I've successfully reproduced this, with 10 files, only 4 in archive, and their contents are all \x00.
Maybe it's the file just got "immutable" when writing. (I'm not a low-level os expert)

So the solution is, keep the files closed when trying to access (archive) them.
You can try to close your file-writing applications, locally or remotely.
With HFS, you can do with macros. Be sure to keep secure.

P.S. What I've tried is following python code:
Code: [Select]
files = []
for i in range(10):
    files.append(open(str(i) + '.txt', 'w', encoding='utf-8'))
while True:
    for i in files:
        i.seek(0)
        i.write('1')
It infinitely writes the file on the first byte (char) until Ctrl+C.
"Computation is not forbidden magic."
Takeback Template | PHFS


Offline Kiego

  • Occasional poster
  • *
    • Posts: 6
    • View Profile
Hi, I tried to close the application (which is writing to file) and I managed to archive all the files. However my operation use is that the data that is coming in are live data which needs to be recorded at all times. If I stop my application, I will will have data loss during the process of archiving. Is there any other way that I can still archive the files with my application running?


Offline danny

  • Tireless poster
  • ****
    • Posts: 281
    • View Profile
You can use the .exec macro to run a batch file, which creates copies or archives. 

batch command for multi-tasking is in this format (so the program doesn't wait until the command finishes)
start "" "program.exe" -o options

In this case, program.exe is your choice of copy or command line zip utility.
For an example of batch file, see my WatchCat script (signature link)


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 858
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Hi Kiego. I've haven't tested, but to copy 'locked' or 'in use' files, you could try Hobocopy or RawCopy. Here you will find a 'how-to' tutorial for Hobocopy, and more similar tools here. To call hobocopy from HFS, you will find macro exec usage here.
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Kiego

  • Occasional poster
  • *
    • Posts: 6
    • View Profile
While trying to use the Macros we found something else. Eg I have the following files:
File1.txt, file2.txt, file3.txt, file4.txt  where file3.txt are constantly writing.
When I select all and press archive, I can only see file1-3.txt but not file4.txt. The content within file3.txt is based on the timing I press my archive button. It seemed like after the remaining files are "discarded" after the constantly writing file.

When I try to extract the tar file using 7zip. I see the following in the properties:
Errors: Header Error
Warnings: There are some data after the end of the payload data.

Would like to ask if other than using RawCopy is there any other ways to prevent the discarding of data while archiving?


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 858
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
When I select all and press archive, I can only see file1-3.txt but not file4.txt. The content within file3.txt is based on the timing I press my archive button. It seemed like after the remaining files are "discarded" after the constantly writing file.
I guess HFS should ignore that file and continue, instead of aborting the 'archive' process (I don't know if this is easy to fix). As a start point, and doing a fast Google Search, I've found an interesting code, HERE.
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 858
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Have you solved this issue? (Have you found a way to copy files being used?). Because I've found an easier way to do it, using 7-Zip. Instead of using HFS's archive function, you can macro call 7-Zip using the -ssw switch (which compress files open for writing). You can even make a .bat (batch) file which does the 7-Zip archive process, and then simply call that batch (.bat) using a HFS's macro (exec). Please tell us, if you need more help...
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline upsidedown

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
Please tell us, if you need more help...

Hi, I would like this. I'm not having the same problem as OP but currently HFS can't archive folders only files, and I'm guessing that if I use 7-zip I would be able to, right?
Thanks.