Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Renaming File
Message
 
To
23/07/2014 15:07:53
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01604496
Message ID:
01604498
Views:
63
You can't have [:] in the file name.
BTW why you use ADIR() and FOR loop just for one file?




>Hello comunity
>
>I have this code but they return always the same error:
>
>
>PROCEDURE RENOMEAR
>lnFiles = ADIR(aFiles, "D:\Trabalho_Clientes\Sgate_BD\Myfile.xlsx")
>FOR lnFor = 1 TO lnFiles
>    IF LEFT(aFiles[lnFor, 1], 1) == "."
>       LOOP
>    ENDIF
>    lcSource = "D:\Trabalho_Clientes\Sgate_BD\"+aFiles[lnFor, 1]
>    *lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+DTOS(aFiles[lnFor, 3]) + aFiles[lnFor, 1]
>    lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+SUBSTR(TTOC(DATETIME(),3),12)+Dtos(aFiles[m.lnFor, 3]) +CHRTRAN(aFiles[m.lnFor, 4],':','') + aFiles[m.lnFor, 1]
>    RENAME (lcSource) TO (lcTarget)
>NEXT
>ENDPROC
>
>
>Error:
>Line: 343
>Message 1: Invalid path or file name.
>
>But if i write :
>
>
>PROCEDURE RENOMEAR
>lnFiles = ADIR(aFiles, "D:\Trabalho_Clientes\Sgate_BD\Myfile.xlsx")
>FOR lnFor = 1 TO lnFiles
>    IF LEFT(aFiles[lnFor, 1], 1) == "."
>       LOOP
>    ENDIF
>    lcSource = "D:\Trabalho_Clientes\Sgate_BD\"+aFiles[lnFor, 1]
>    *lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+DTOS(aFiles[lnFor, 3]) + aFiles[lnFor, 1]
>    lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+Dtos(aFiles[m.lnFor, 3]) +CHRTRAN(aFiles[m.lnFor, 4],':','') + aFiles[m.lnFor, 1]
>    RENAME (lcSource) TO (lcTarget)
>NEXT
>ENDPROC
>
>
>this work fine ??
>What i need is adding the time and minutes and secunds before the date:
>in this moment, the file is rename like that:
>
>20140723192550myfiler.xlsx , where 192550 is the creation date of my file.
>
>How can do that.
>Many thanks
>Luis Santos
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform