Since the MoveFile() API call does allow you to move a file from one partition to another, I would assume that the documentation is incorrect in this case.
In DOS, the "rename" OS call did not allow that, so it was probably a left-over item from the DOS/16-bit Windows docs.
--Dave
------------------
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Name across Partitions(??)
Collapse
X
-
Neil, I think you miss the point here.
The point is:
"Can I trust a Keyword is doing what the description
says it do?"
In this particulare case the description of "NAME" does
not state that:
"Renaming cross partition generates an runtime-error"
(this would have been wrong)It says:
You can't move a file from one disk or partition to another
And this is also wrong
The sad side of the story is that the helpfile is wrong and
the printed documentation is correct.
Imagine how handy a small textfile "PowerBasic HelpFile/Documentation changes" would be.
------------------
Fred
mailto:[email protected][email protected]</A>
http://www.oxenby.se
Leave a comment:
-
DOS COPY has never been able to rename acroos drives, weather
they are partitions or physical drives, you need to use XCOPY
or pull your head in and write 30 lines of code to do it .
Leave a comment:
-
Yes Dave, thats correct but I choosed to use "Name" because..
NAME
Purpose
Rename a file or a directory (like the DOS REN command).
Syntax
NAME filespec1 AS filespec2
Remarks
filespec1 and filespec2 are string expressions conforming to DOS path
and file naming conventions.
NAME gives the file or directory represented by filespec1 the name filespec2.
Since filespec2 can contain a path name, it's possible to move a file
or a directory) from one directory to another.
You can't move a file from one disk or partition to another.
There is no statment saying that PB internally use 'MoveFile' Api.
Sure, this is a "documentation-error" and nothing else..
--------
The problem reported from the field is related to a migration from
Win95 to NT4 and MoveFile API says
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
But I still need some help to verify if "Name" works across
diskdrives/UNC-shares on old Win95/Win98 preferably on Novell networks.
It will be a P*I*A* to change, but thats my headache.
Thanks to all for your help
-------------
Fred
mailto:[email protected][email protected]</A>
http://www.oxenby.se
Leave a comment:
-
Internally, PowerBASIC uses the "MoveFile" API to rename a file or directory. Here are the "notes" from the API:
"The MoveFile function will move (rename) either a file or a directory (including all its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume."
--Dave
-------------
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
Name across Partitions(??)
I have an application...
well in short one application on a workstation is monitoring
folders on FileServers (Novell 4) for files to move to predefined
destinations.
If Source and targetfolder is on same drive i re-"Name Srce,Target"
otherwise I let another workstation (slave) do the work ("Copy/Delete")
My customer has used Win95 platform. All has worked well.
Yesterday they changed to WinNT-platform and you probably don't believe
this, but then the job for cross-partition-moves were not handed over to
the slave. It was performed as a "Name Srce,Target" operation.
Well this proves the help-file to be wrong!
I then tested the same on Win98SE
Also in Win98Se you can rename a file cross partition boundaries
Someone having nonSE Win98 who can perform the same test?
Thank you!
-------------
Fred
mailto:[email protected][email protected]</A>
http://www.oxenby.se
Tags: None
Leave a comment: