My Queue.xml is gone :( Program adjustments needed!

Archived discussion about features (predating the use of Bugzilla as a bug and feature tracker)

Moderator: Moderators

deepdown
Posts: 10
Joined: 2003-02-05 20:58

My Queue.xml is gone :( Program adjustments needed!

Post by deepdown » 2003-10-22 11:29

After my computer crashed. (not due to dc++, it was some other program)
I had to use reset.

Started dc++ up again, and my download list is empty :(

I check the Queue.xml file -> notepad, and it contains all BLANKs
(like blanks spaces..) The file was up to 1.3Kb big with blanks.

Would it be easy to add an option into the program, saving the Queue.xml file to a backup_Queue.xml every given hour/minute/etc..

please,
this option would be really, really nice to have!!!
(and I think I speak for a lot of people 8) )

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-22 13:59

while waiting for this feature...

create a batch file that will copy Queue.xml to an other folder.
set windows scheduler to start the batch file as often as you want.

ex:
copyqueue.bat

Code: Select all

if not exist c:\temp mkdir c:\temp
copy C:\Program Files\DC++\*.xml c:\temp
exit
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

deepdown
Posts: 10
Joined: 2003-02-05 20:58

Post by deepdown » 2003-10-22 20:53

This is a good solution.
But then again - it requires and effort of setting up the schedule options in windows :?

I have implantet your suggestion (which I believe for now is a good one! :P )
But I really would like to see the "save option" implanted into the program in the near future.

Thanx for sharing interest! :D

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-23 01:46

note that in win98, the DOS box does not close by default.

you will need to create a .pif for the batch file.
to do so easely, while the DOS box is open, clic on the properties button.
notch "close on exit".

if not done you could end up with a lots of DOS box open, if using with the scheduler. :wink:
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

deepdown
Posts: 10
Joined: 2003-02-05 20:58

Post by deepdown » 2003-10-23 09:33

i'm using win2000
Made av backup.bat file, but when I run it it tells me;
-----------
C:\>if not exist c:\Program Files\DC++\backup mkdir c:\Program Files\DC++\backup

The system cannot find the path specified.

C:\>copy C:\Program Files\DC++\*.xml c:\Program Files\DC++\backup
The system cannot find the file specified.

C:\>pause
Press any key to continue . . .

Solution;
if not exist "c:\Program Files\DC++\backup" mkdir "c:\Program Files\DC++\backup"
copy "C:\Program Files\DC++\*.xml" "c:\Program Files\DC++\backup"
exit

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 19:37

Post by TheParanoidOne » 2003-10-23 11:46

Paths with spaces in them must have quotes ("") around them, as you have already figured out.
The world is coming to an end. Please log off.

DC++ Guide | Words

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-23 11:48

i tough you had win9x.
but yes, i forgot the the quotes where needed in w2k batch files.
thanks to point it out. :)
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-10-24 23:40

deepdown wrote:But I really would like to see the "save option" implanted into the program in the near future.


The most obvious problem is: how do you know when a bad queue.xml is backed up over a good one?

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-25 00:33

The most obvious problem is: how do you know when a bad queue.xml is backed up over a good one?

hehe
that's a good one here. :)

i will see what i can do to add the date to those files name.
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-10-25 00:45

While that applies to your program, it's more of a "if I were to code this, here's a problem" type of question. Certainly DC++ can keep 10 backups (or a similar number), but there is a non-zero chance that they could all become corrupt - especially if it's one per hour, you'll only notice the corruption when you restart dc++.

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-25 01:35

i see what you meen.
beside my modify batch file would brings other problems too.(HD space)

what about.
DC++ save the XML files, and if DC++ initialise correctly at startup, it back them up.
if initialisation fail, DC++ fall back to use the backup files.
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Twink
Posts: 436
Joined: 2003-04-01 04:31
Location: New Zealand

Post by Twink » 2003-10-25 02:23

i presume when dc++ finishes writing the queue its a good file, or is that a bad presumption. ie write file, if it completes then do a backup automagically.

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-10-25 02:50

if the file is open(not in read mode only)and DC crash chance that the file will also get corrupted are high.
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

deepdown
Posts: 10
Joined: 2003-02-05 20:58

Post by deepdown » 2003-10-25 09:31

True. Its hard to know - when dc++ will make the queue.xml file corrupt.
But in my case.. dc++ works great, until some other software f... up the pc and I have to reboot.

A backup option could work like this;
check queue.xml file for standard "begin" and "end" quotes.
check queue.xml file for unfinished "<" and ">" tags.
check queue.xml file for bizzare signs like " " (spaces which my file got loaded up with)

Also the backup could be incremental.
Doing on backup now.. 1.file.
then 2 hours later, do another backup to a 2.file
2 hours later again, checking about the faults (described above)..and then backup over the first file.
continues..

would this work ?

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 19:37

Post by TheParanoidOne » 2003-10-25 10:39

If you were working purely independently of DC++, it could be done using just one backup file, but the script would be slightly more complicated:

Every hour:
Check validity of Queue.xml using an XML parser.
If valid, back it up
else make an entry in a log file

This gets rid of the problem of overwriting a good queue with a bad one (touch wood!) and the problem of keeping multiple copies (but it would make sense to have at least 2 backup, just in case).

This does however mean that you need some kind of command line XML parser.
The world is coming to an end. Please log off.

DC++ Guide | Words

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-10-31 01:09

deepdown wrote:check queue.xml file for standard "begin" and "end" quotes.
check queue.xml file for unfinished "<" and ">" tags.
check queue.xml file for bizzare signs like " " (spaces which my file got loaded up with)


Doing this would add a lot of complexity to DC++ to cover this infrequent happening... From what I've seen, it doesn't look like DC++ itself is corrupting the files, so perhaps it's best to have someone write a program (even in VB or simliar) especially if you're doing the XML checking I quoted above.

deepdown
Posts: 10
Joined: 2003-02-05 20:58

Post by deepdown » 2003-11-02 15:31

True.
It might be to much and makes the dc++ program difficult.
hmm.. maybe a VB program would be nice :)

jevon
Posts: 1
Joined: 2003-11-04 04:21
Location: New Zealand

Post by jevon » 2003-11-04 04:23

VB program might be best.
Or alternatively you could keep a selection of backups, ie.

copy queue.backup2.xml queue.backup3.xml
copy queue.backup.xml queue.backup2.xml
copy queue.xml queue.backup.xml

that way, if one queue file is corrupted, you have another two to try out beforehand ^_^

of course, the best solution is something in DC... or fixing the problem so that it doesn't destory the queue.xml in the first place ;)

TheNOP
Posts: 275
Joined: 2003-07-08 02:41
Location: Quebec

Post by TheNOP » 2003-11-04 15:18

jevon wrote:or fixing the problem so that it doesn't destory the queue.xml in the first place

the most frequent queue problems are cause by windows crash.
you want DC++ coder to fix windows ? :twisted:
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-11-04 16:20

jevon wrote:of course, the best solution is something in DC... or fixing the problem so that it doesn't destory the queue.xml in the first place ;)


Did you catch this? :)

GargoyleMT wrote:From what I've seen, it doesn't look like DC++ itself is corrupting the files, ...


That was a nice way of saying: if (somehow) it's a DC++ bug, we'll fix it, but if it's not DC++ that is causing the corruption (and it seems that it is another application), don't expect a workaround inside of DC++.

Who is online

Users browsing this forum: Google [Bot] and 0 guests