- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using RenameFileQQ to rename a directory.
I have noticed that the documentation only says it renames a file.
I have used the code previously to rename a directory and it works.
use ifport,only:RenameFileQQ logical*4 lret lret=RenameFileQQ("c:\Grade\data\TEST","c:\Grade\data\1234")
In the previous version that worked, I was using a BrowseForFolder routine but in the new code that doesn't work I'm using a BrowseForFile routine.
The BrowseForFolder routine was from a file CommonDlgXtras.f90 which I got from the forum from John Termine.
The BrowseForFile routine uses GetOpenFileName
The error I get after RenameFileeQQ using GetLastErrorQQ is error 13 ERR$ACCES - Permission denied. The file's permission setting does not allow the specified access
Do you have any suggestions why this is not working?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The documentation does say it renames a file but it is renaming a directory for me with our latest PSXE 2017 Update 1. I need to inquire if that is expected/supported.
What version of our compiler are you using?
Did you verify the appropriate permissions exist on all components of the path and the directory that is getting renamed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess... GetOpenFileName is changing the current directory to be the same as the directory you are trying to rename.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin,
The compiler is Intel(R) Visual Fortran Compiler XE 12.1.4.325
Ian,
Your guess was correct - I reset the current directory and it worked.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the version id. Glad you resolved it. I'm told RENAMEFILEQQ will work for folders/directories too but it is odd seeing MAKEDIRQQ, DELDIRQQ, CHANGEDIRQQ but no "RENAMEDIRQQ". I will follow up w/the documentation writers about adding clarification.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page