 |
|
BaselScript |
Beschreibung
Datei umbenennen
Um eine Datei umbenennen, muss man den Dateinamen und den Pfad kennen.
rename file=name to=name directory=name
Beispiel:
rename file=person2 to=new_person directory = /APPDIR/work/example
Beispielskript:
scene =1 name = "rewrite and rename" bgcolor=gray
section init
#t = "rewrite the file example_person to person2 and rename the file person2 to the file new_person"
end section
form
tile=text name=title1 x=10 y=340 w=780 h=300 text =#t size = 40 color = white gravity=center
tile=button name=#button_start x=100 y=600 w=600 h=100 text = "Start" size=35 color=white bgcolor=black section=but_start
end form
section but_start
call scene = 2
end section
end scene
---------------------------------------------------------------------------
scene=2 name="rewrite and rename" bgcolor = gray
// source file
file example_person(#name_person,#vorname_person,#city_person,#street_person,#birthday_person)
// target file
file person2(#vorname_person,#name_person,#city_person,#street_person,#birthday_person, #tel)
section init
#exist = $exist_file("/APPDIR/files",example_person)
if #exist == 1
rewrite file=example_person to_file=person2 directory = "/APPDIR/files"
rename file=person2 to_file=new_person directory = "/APPDIR/files"
message "process is done"
else
message "file example_person no exist"
endif
end section
section back
call script=empty
end section
end scene 2