Rename Files

Previous topic - Next topic

Hemlos

Code ((DOS styled)) Select

FUNCTION RENAME: filename$,newfilename$
     IF DOESFILEEXIST(filename$) //in=true
          COPYFILE filename$,newfilename$
          KILLFILE filename$
          RETURN 1
     ELSE //in=false
          RETURN -1
          // "The system cannot find the file specified."
     ENDIF
ENDFUNCTION


Code ((Prevents Overwrite)) Select

FUNCTION RENAME_PROTECTED: filename$,newfilename$
IF DOESFILEEXIST(filename$) //filename=true
IF DOESFILEEXIST(newfilename$)
RETURN 0
// overwrite protected
ELSE //filename=true newfilename=false then rename
COPYFILE filename$,newfilename$
KILLFILE filename$
RETURN 1
// file copied
ENDIF
ELSE //filename=false
RETURN -1
//"The system can not find the file specified."
ENDIF
ENDFUNCTION
Bing ChatGpt is pretty smart :O

Kitty Hello

very nice. thank you.

Hemlos

Quote from: Kitty Hello on 2008-Oct-11
very nice. thank you.

Youre welcome,

I saw this as an idea/addition for the editor as a command in a german thread, so i thought i could save you some time ;)

As i dont read german language so well...Dutch is very confusing for me to read:
I THINK the person responsed with critisizism.
I assume (re: not good reader of dutch lang), it was due to large file sizes.
Bing ChatGpt is pretty smart :O

D2O

Hello Hemlos,

yes so also already uses the whole one I, however, it goes me a file umzubenenen ohner the whole one therefore first
to copy.

Little one files are no problem.
However, big files need through it too long.

Example:
Films, DVD...... umbenenen.
There, some equal GB together.

Under Windows, one can call the CMD with GLB and uses "Rename."
But just only Win.
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Hemlos

#4
I understand, big files are being copied and makes it takes too much processing time because of COPY.

I have been working on this issue today, and i cant find a way to "inline" the rename command....msdn.com is hard to understand, as hard as dutch LOL ;)

Suggestion if gernot is not able to help you:
Use my function with multithreading? ...here i will build that code tonight, and i will update/add it to the first/top message in this thread topic....should be easy....but i dont know if it will solve the problem 100%.

May i ask, why would you need to rename a 1gb+ movie?
Bing ChatGpt is pretty smart :O

D2O

Clearly, you can ask.

It goes to separate nich speziel generel me about film files about file umbenenungen.
Now and then, I use GLB to write small tools only about me.

For example, I has play "UNREAL TOURNAMENT" a tool written this to me me for this
the Cache files into usable Map, sound.... rewrite.

Rename also is not really vital, it be can be only one stimulation the sowas very useful.


I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Hemlos

Ahh tools ya...i made a game tool for Battleground europe WW2online. A rangefinder for using mortars and for ranging soldiers weapons, and ranging tank munitions.

i have it on my website, but for now its only available to my old squad, i cant release it public yet.

Your ideas have pushed me into tinkering with playmovie commands lol

I found bugs and ended up spending my time debugging them, and posting in bug section.
Bing ChatGpt is pretty smart :O