Is there any MDL api for moving dgn from one folder to another folder in microstation version v8?
Hi Sujit,
You may investigate mdl_Filexxx functions. Functions are updated starting from MicroStation v8i version 8.0.0. In my opinion mdl_Filexxx functions must be developed. You can also use ANSI C functions inside stdio.h as Jan said.
I think there is no Move functions. Copy and delete file may be an alternative but it isn't an optimistic solution.
Kind regards,
Sedat AlisAEC Technology Inc.
Thanks Sedat for your valuable answer, After lot of investigation i am not finding any mdl_Filexxx functions for moving dgn. But i got 'remove' function in ANSI C functions inside stdio.h. remove function can delete dgn in particular folder. First we have to copy the dgn then we can use remove function to.
Sujit Bhunia said:First we have to copy the dgn then we can use remove function to.
But it's exactly what standard C rename() function does automatically at background.
Did you try my original suggestion to use rename() function?
I have not so old MicroStation installed, so I am not able to test it, so I am not sure whether MDL implementation of standard C library respects this behavior.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
As Jan said, rename() function in stdio.h also moves the file. oldname and newname are actually full paths. I have an ANSI C booklet from Microsoft, it even doesn't say that you can use rename for move too.
int rename(const char * oldname, const char * newname);
rename() function is defined in stdio.h header file. It renames a file or directory from oldname to newname. The rename operation is same as move, hence you can also use this function to move a file.
rename()
stdio.h
oldname
newname
Reference: https://codeforwin.org/2018/03/c-program-rename-a-file-using-rename-function.html
It is working for me thanks for shared