I have tried to find a replacement for the old renamefile/2 predicate without luck so far.
Any hints?
Regards,
Loffy
-
- VIP Member
- Posts: 458
- Joined: 5 Nov 2000 0:01
Re: Rename File
See file::move/2 and file::move/3
Moves file to another location.
Description
The predicate moves(renames) a file specified by Filename to the location, specified by Destination path.
If Destination is a new file name, then the file will be moved to a new location and renamed simultaneously, otherwise it's assumed that Destination is an existing directory and the file will be moved into it.
If Destination already contains file with the same name, then the file will be overwritten.
Both names may have the full-qualified or relative paths.
Exceptions
nativeCallException is raised if internal API function call failed
Code: Select all
move : (
string Filename,
string Destination).
Description
The predicate moves(renames) a file specified by Filename to the location, specified by Destination path.
If Destination is a new file name, then the file will be moved to a new location and renamed simultaneously, otherwise it's assumed that Destination is an existing directory and the file will be moved into it.
If Destination already contains file with the same name, then the file will be overwritten.
Both names may have the full-qualified or relative paths.
Exceptions
nativeCallException is raised if internal API function call failed
-
- Active Member
- Posts: 47
- Joined: 15 Aug 2019 11:32
Re: Rename File
Harrison,
Thanks again.
Regards,
Loffy
Thanks again.
Regards,
Loffy
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
-
- VIP Member
- Posts: 458
- Joined: 5 Nov 2000 0:01
Re: Rename File
setName/2 only changes a string containing a fully qualified file name. It doesn't do anything to a file.
It belongs to the same family of functions as setPath/2and setExtension/2.
It belongs to the same family of functions as setPath/2and setExtension/2.