Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Path RenameExtension

I have been trying to use SRP_Path. The result I am getting indicates that it was successful. Or it at least returns what appears to be a successful result based on the documentation.

Here is a sample of my test data
Equ FtpInFolder TO "L:\compassg\locations\"
ThisFile = 'sbtest.txt'
NewFileName = 'sbtest.done'
*Result = Utility( "RENAMEFILE", FtpInFolder:ThisFile, FtpInFolder:NewFileName)
Result = SRP_Path("RenameExtension", FtpInFolder:ThisFile, ".done")
Errors = Error_Services('GetMessage')
Debug
return

There is no error message set and Result is set to "L:\compassg\locations\sbtest.done". This appeared to indicate success. However, the file name did not change.
After my test I changed to the Utility function commented out and it successfully changed the filename. I wanted to eliminate any issues with permissions. I also tried setting the extension to "don" in case it was a length issue.

Does anyone see anything wrong with my test code or have any suggestions. Perhaps an issues with using equates?

Comments

  • SRP_Path does not alter the actual file system. SRP_Path only manipulates strings.

    Also, Error_Services is a Frameworks service. SRP Utilities services do not use it.
  • No wonder it didn't work.....duh I must say I once I had it in my head how sweet a tool to rename files this was I just couldn't see that it was only for string manipulation.

    Thanks Kevin for clarifying and being gentle about it. Good thing Don was on vacation (-:

Sign In or Register to comment.