Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to rename a folder 2

Status
Not open for further replies.

erft

Programmer
Aug 18, 2004
2
0
0
PL
Dear All,
I am just unable to proceed folder rename - however the folder that is not empty. I've tried TSHFileOpStruct structure in numerous configurations but with little success (there is something wrong with pFrom and pTo fields: when assigning to string indicating a path, double backslash is turned into single).
Do you have some experience in this field?
Thank you in advance.
 
Why not use the VCL encapsulation RenameFile. It's much easier to use.

James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
I thougth the same, but what he wants is to rename a folder not a file.

--- LastCyborg ---
 
The double backslash to one is a C-thing IF YOU HAS CONSTANTS.

I.e. const char Testvariable[] = "c:\\Test";
actually contains "c:\Test" (without ") as C-compiler converts different special characters by using backslash-and-the-next to indicate which special character:
'\r' is carriage return (ASCII 10)
'\n' is Newline (ASCII 13)
'\b' is Bell (ASCII 7)
'\t' is Tab (ASCII 8)
(taken from memory, the ASCII values might be wrong)
There are other combinations also.

So, to get a backslash in a written constant you use '\\' where the first backslash Means "special character" and the second means Backslash.

Totte
Keep making it perfect and it will end up broken.
 
LastCyborg,
[tab]RenameFile will work with directories, too. Sorry, I forgot to mention that.

Totte,
[tab]Did you mean to post that here or did the system post that in the wrong thread???

James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top