News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Renaming a file

Started by RuiLoureiro, April 11, 2008, 04:05:30 PM

Previous topic - Next topic

RuiLoureiro

Hi all,
          I want to rename a file but i dont know how. I tried to use ReplaceFile but i have not the constant REPLACEFILE_WRITE_THROUGH in the windows.inc. How to do this ? Any help ?

New:

          I found MoveFileEx but i have the same problem with MOVEFILE_WRITE_THROUGH.
          It is not defined in windows.inc. Anyone knows the value ?

Thank you
Rui

hutch--

Rui,

Try this API.


BOOL MoveFile(
    LPCTSTR lpExistingFileName, // address of name of the existing file 
    LPCTSTR lpNewFileName // address of new name for the file
   );


This is the equate value from winbase.h.


#define MOVEFILE_WRITE_THROUGH          0x00000008


In MASM it should be,


MOVEFILE_WRITE_THROUGH equ 00000008h


LATER:

You must be using a very old windows.inc, the current two file version contains the equate. Download the latest release version from the masm32 subforum.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

RuiLoureiro

Hello Hutch,
                   Thank you.

                   Yes i think it is a very old windows.inc, but i am going to download the latest release version from the masm32 subforum.

Thanks
Rui