The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Q: Renaming files on file-system
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hajo_old

Germany
141 Posts

Posted - 03/17/2003 :  05:17:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, all

for my project I need to search some files on my hard disk, check their names and eventually rename them according to my needs.

In OriginC I find some functions for accessing (opening, reading, writing) files, but not "only" renaming the filename, without the "workarround" to open the source, read it in, creating the new file (with new name) and writing the source to the target.

How can I simply rename a file by using OriginC or LabTalk?
Thanks
Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1

Mike Buess

USA
3037 Posts

Posted - 03/17/2003 :  07:38:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hajo,

First, make a copy with this LabTalk command...
file -c "srcPath\Name" "destPath\Name";

Next, delete the original in OriginC...
DeleteFile("srcPath\Name");

Mike Buess
Origin WebRing Member
Go to Top of Page

hajo_old

Germany
141 Posts

Posted - 03/17/2003 :  08:12:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike

thanks, as we here in Germany say: I don't see the forrest because of all these trees!! (Is there something like that in English?)

But a pure OriginC sollution isn't possible?!

Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/17/2003 :  08:30:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi again,

>thanks, as we here in Germany say: I don't see the forrest because of all these trees!! (Is there something like that in English?)

Yes, it's nearly a direct translation.

>But a pure OriginC sollution isn't possible?!

Not that I am aware of. Not yet, at least.

Mike Buess
Origin WebRing Member
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 03/17/2003 :  09:07:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following has been added and will appear in SR4, which should become available in a week or sooner.

BOOL RenameFile(LPCSTR lpcszNewFilename, LPCSTR lpcszOldFilename);


CP


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000