en:docs:fapi:dosmove

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:fapi:dosmove [2021/08/20 04:16] prokusheven:docs:fapi:dosmove [2021/09/17 06:31] (current) prokushev
Line 5: Line 5:
 This call moves a file object to another location and changes its name.  This call moves a file object to another location and changes its name. 
  
-==Syntax== +===== Syntax =====
- DosMove (OldPathName, NewPathName, Reserved)+
  
-==Parameters== +<code c> 
-;OldPathName (PSZ) - input : Address of the old path name of the file to be moved. +DosMove (OldPathName, NewPathName, Reserved) 
-;NewPathName (PSZ) - input : Address of the new path name of the file. +</code> 
-;Reserved (ULONG) - input : Reserved and must be set to zero.+ 
 +===== Parameters ===== 
 + 
 +  OldPathName ([[PSZ]]) - input : Address of the old path name of the file to be moved. 
 +  NewPathName ([[PSZ]]) - input : Address of the new path name of the file. 
 +  Reserved ([[ULONG]]) - input : Reserved and must be set to zero. 
 + 
 +===== Return Code ===== 
 + 
 + rc ([[USHORT]]) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-*0   NO_ERROR 
-* 2   ERROR_FILE_NOT_FOUND  
-* 3   ERROR_PATH_NOT_FOUND  
-* 5   ERROR_ACCESS_DENIED  
-* 17   ERROR_NOT_SAME_DEVICE  
-* 26   ERROR_NOT_DOS_DISK  
-* 32   ERROR_SHARING_VIOLATION  
-* 36   ERROR_SHARING_BUFFER_EXCEEDED  
-* 87   ERROR_INVALID_PARAMETER  
-* 108   ERROR_DRIVE_LOCKED  
-* 206   ERROR_FILENAME_EXCED_RANGE  
-* 250   ERROR_CIRCULARITY_REQUESTED  
-* 251   ERROR_DIRECTORY_IN_CDS 
  
-==Remarks==+  * 0   NO_ERROR 
 +  * 2   ERROR_FILE_NOT_FOUND  
 +  * 3   ERROR_PATH_NOT_FOUND  
 +  * 5   ERROR_ACCESS_DENIED  
 +  * 17   ERROR_NOT_SAME_DEVICE  
 +  * 26   ERROR_NOT_DOS_DISK  
 +  * 32   ERROR_SHARING_VIOLATION  
 +  * 36   ERROR_SHARING_BUFFER_EXCEEDED  
 +  * 87   ERROR_INVALID_PARAMETER  
 +  * 108   ERROR_DRIVE_LOCKED  
 +  * 206   ERROR_FILENAME_EXCED_RANGE  
 +  * 250   ERROR_CIRCULARITY_REQUESTED  
 +  * 251   ERROR_DIRECTORY_IN_CDS 
 + 
 +===== Remarks ===== 
 This call is often used to change only the name of a file or subdirectory, allowing the file object to remain in the same subdirectory. Global file name characters are not allowed in the source or target name. This call is often used to change only the name of a file or subdirectory, allowing the file object to remain in the same subdirectory. Global file name characters are not allowed in the source or target name.
  
Line 39: Line 47:
 Attributes (times and dates) of the source file object are moved to the target. If read-only files exist in the target path, they are not replaced. Attributes (times and dates) of the source file object are moved to the target. If read-only files exist in the target path, they are not replaced.
  
-DosQSysInfo is called during initialization by an application to determine the maximum path length allowed by OS/2.+[[DosQSysInfo]] is called during initialization by an application to determine the maximum path length allowed by OS/2.
  
 DosMove can be used to change the case of a file on an FSD drive. The following example would change the name of the file to "File.Txt". DosMove can be used to change the case of a file on an FSD drive. The following example would change the name of the file to "File.Txt".
  DosMove("file.txt","File.Txt")  DosMove("file.txt","File.Txt")
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosMove when coding for the DOS mode: Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosMove when coding for the DOS mode:
  
 File names passed to OldPathName and NewPathName are truncated by the system in the DOS mode only. The application must truncate all files passed to OldPathName and NewPathName in the OS/2 mode or an error code is returned. File names passed to OldPathName and NewPathName are truncated by the system in the DOS mode only. The application must truncate all files passed to OldPathName and NewPathName in the OS/2 mode or an error code is returned.
  
-==Example Code== +===== Example Code ===== 
-===C Binding=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
  
Line 61: Line 72:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosMove:FAR EXTRN  DosMove:FAR
 INCL_DOSFILEMGR     EQU 1 INCL_DOSFILEMGR     EQU 1
Line 72: Line 84:
 PUSH   DWORD               ;Reserved (must be zero) PUSH   DWORD               ;Reserved (must be zero)
 CALL   DosMove CALL   DosMove
 +</code>
  
 Returns WORD Returns WORD
-</PRE> 
  
-=== Note ===+ 
 +===== Note ===== 
  
 Text based on [[http://www.edm2.com/index.php/DosMove_(FAPI)]] Text based on [[http://www.edm2.com/index.php/DosMove_(FAPI)]]
  
 {{page>en:templates:fapi}} {{page>en:templates:fapi}}