rejetto forum
February 11, 2012, 01:30:47 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Autorename of duplicate files  (Read 3994 times)
0 Members and 1 Guest are viewing this topic.
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #15 on: May 27, 2009, 06:44:10 AM »

Guys, i think all this doesn't resolve my issue, cause even if i shorten the filename file(1).txt, next time HFS will look up for file (1).txt  Cheesy
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1469



View Profile WWW
« Reply #16 on: May 27, 2009, 06:55:01 AM »

TO rejetto:

son problème est là où l'espace est en trop
Quote
 while fileExists(data.uploadDest) do
    begin
    inc(i);
    data.uploadDest:=format('%s\%s (%d)%s', [f.resource, fn, i, ext]);
    end;

à toi de définir si on doit retirer l'espace ou alors le remplacer par un  '_'
Quote
 while fileExists(data.uploadDest) do
    begin
    inc(i);
    data.uploadDest:=format('%s\%s_(%d)%s', [f.resource, fn, i, ext]);
    end;
« Last Edit: May 27, 2009, 07:04:03 AM by mars » Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #17 on: May 27, 2009, 06:57:33 AM »

I roughly understand what you wrote, but if you write in english is better  Grin
Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1023


....... chut ! shh!


View Profile WWW
« Reply #18 on: May 27, 2009, 07:28:49 AM »

Guys, i think all this doesn't resolve my issue, cause even if i shorten the filename file(1).txt, next time HFS will look up for file (1).txt  Cheesy

   
No, you misunderstood.
The solution given by mars, simply removes the space in the file name:

' (' By '('

eg:
file (1).txt > file(1).txt

file (2).txt > file(2).txt

So this solution must work.

****************************************
The post in french is for rejetto... it concerns the programming of hfs.
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #19 on: May 27, 2009, 07:54:29 AM »

No , i didn't misunderstood. It's just like rejetto explained before:

Quote
this solution does not work very well.
because it renames " (1)" to "_(1)".
next time, HFS will give again " (1)" because there's no file with such name.
and again, the script will try to rename it to "_(1)", but this one already exists.
the result is: the second time the file is not renamed.

So the result is

file.ext

file(1).ext

file (1).ext

file (2).ext

and so on.

I hate spaces!  Angry
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #20 on: May 27, 2009, 08:51:39 AM »

Where i can find the complete list of all hfs events?  Cry (maybe with description)
Logged
rejetto forum
« Reply #20 on: May 27, 2009, 08:51:39 AM »

Do you like this software? Consider even $2
 Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #21 on: May 27, 2009, 09:45:42 AM »

i will write a better script asap, in the while you should answer these questions Tongue

what's in your system that doesn't support space in file names?
did you try surrounding with "double quotes" ?



Where i can find the complete list of all hfs events?  Cry (maybe with description)

menu > help > full guide
http://www.rejetto.com/wiki/index.php/HFS:_Event_scripts
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #22 on: May 27, 2009, 10:53:51 AM »

Well, actually my hfs.events is:

[+upload completed]
{.exec|cmd.exe /K mencoder %item-resource% -o %folder-resource%\[previews]\%item-name%.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=256:mbd=2:trell:last_pred=1.}

And works. Well, to be honest i cannot cut the /K parameter and tons of cmd remains open, but... Grin

Quoting and spaces make this no longer work.

In addition, i already told my mates to save their file with underscore, if i revert they will kill me  Grin
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #23 on: May 27, 2009, 11:05:49 AM »

Can you add [on file deletion]?

I explain you why.

You know i store previews in [previews] subfolder , i integrate the modifications made by French Can Can to add "delete" options to RAWR template. Now i had to intruct HFS not only to delete file on request, but also the related preview  Wink

I know i'm asking you much, and i would like to donate, but i can't do it via Internet. Is there any other way to do it? (al limite ti faccio un bonifico o un vaglia Tongue)
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #24 on: May 27, 2009, 11:42:16 AM »

Quoting and spaces make this no longer work.

i think you misunderstood.
use "%item-resource%" instead of %item-resource%.
on command line, file with spaces must be quoted.

ok, i will add an event for deletion.

se clicki donate ottieni già le informazioni per il bonifico Smiley
comunque non ti preoccupare, una donazione fa sempre piacere, ma non è certo per soldi che do l'assistenza, altrimenti non ti basterebbero €100 Cheesy
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #25 on: May 27, 2009, 12:16:30 PM »

Quote
use "%item-resource%" instead of %item-resource%.

No i understood but... OMFG i never imagined that it could work, indeed it works!!!  Grin

I would expect "mencoder error: could not find file %item-resource%". Shit! I must remember to always do ALL tests! Now it will be hard to tell my mates "ehm...remember i told you to put underscores instead of spaces? Now put back spaces instead of underscores"  Embarrassed Grin

Quote
ok, i will add an event for deletion.

Thank you VERY much ^_____^

Quote
se clicki donate ottieni già le informazioni per il bonifico

Ah! Non avevo mai cliccato perchè pensavo fosse solo PayPal!

No, tranquillo non sto cercando di "comprarti" l'asistenza, voglio farti una donazione perchè mi piace il tuo software e perchè sei disponibile nell'assistenza  Grin Wink
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #26 on: May 27, 2009, 12:31:07 PM »

you can use a tool to rename all underscores with spaces in the files you already got.
it takes seconds.
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #27 on: May 28, 2009, 04:44:47 AM »

Yes , i know. Computers don't complain, people often do.  Grin
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page Today at 10:53:12 AM
anything