Silverfrost Forums

Welcome to our forums

get_filtered_file closes application

2 Aug 2020 11:44 #26151

If I use get_filtered_file and then use the interface to delete an existing file, my application hangs for a few seconds, and my application closes, apparently before get_filtered_file returns. I am compiling in 32-bit (64-bit generates an allocate_backend_symbol error that I reported in a different post, but have not yet been able to isolate in a small program), and the compiler options do not seem to make a difference. Is there something I can do to stop the application closing?

3 Aug 2020 3:14 #26153

Are you specifying 'Must_Exist' or 'Can_Exist'?

I have seen odd behavior using /CHECKMATE with file/folder operations. What are you using?

3 Aug 2020 5:57 #26154

simon

Can you supply a small working sample that replicates the behaviour?

5 Aug 2020 8:29 #26178

If I try to delete a file from the prompt using the following, it seems to stop before printing the message on the last line, but if I select a file or cancel or close the prompt using the X the message is printed. I have the same problem whether I use /CHECKMATE or not.

WinApp
Program p
!
   Character(Len=256) :: ffile ! - selected file -
   Character(Len=256) :: idir  ! - input directory -
!
   External :: get_filtered_file@
!
   ffile = ' '
   idir = '.'
   Call get_filtered_file@ ('Test', ffile, idir, (/'All'/), (/'*.*'/), 1, 1)
   Print *, 'Test completed'
End Program p

I am running on Windows 10, and using FTN 8.61.0 built on 4 Feb 2020.

6 Aug 2020 6:43 #26179

Simon

Your program runs OK for me. I assume that you are using the Open/Save dialog to delete a file. I did not try to delete a protected file but it should not make any difference.

Perhaps you could post a video to show the failure.

You could try calling clearwin_option@('alt_open_save') but I doubt that it will make any difference.

6 Aug 2020 8:19 #26180

Simon,

It never occurred to me that you could delete a file from this dialog, but your test program works for me (32 bit v8.50 FTN95 with 64-bit Windows) whether I use the Del key or do a mouse right click to bring up a menu or close the dialog.

The error you report is not present on my PC.

When using this approach to select a file to Open, the dialog simply selects the file name and the file must be opened with a Fortran Open statement. Knowing that is why it probably didn't occur to me to use it to delete a file, thinking it might take something else to do the actual deletion.

You learn something every day!

Eddie

6 Aug 2020 9:10 #26181

Well Paul, your suggestion to try using the clearwin_option seems to have solved the problem!

To describe more carefully what I have been doing.

  1. I run this programme
  2. From the list of files, I select one using the right mouse button
  3. From the pop-up menu I choose 'Delete'
  4. The programme rather hesitantly deletes the selected file, sometimes showing a progress bar, but not always
  5. The window then closes and the programme message fails to appear

I will find out how to to create a video, if that would still be useful.

7 Aug 2020 2:00 #26182

Hi Eddie,

I am getting some users reporting this problem and others saying it works fine, so perhaps there is some key difference in the Operating System.

I discovered the ability to treat such open-file dialogues as if they were Windows Explorer from somebody who did not know about Explorer and thought that was the only way to manage files!

Best wishes,

Simon

7 Aug 2020 5:36 #26183

Simon

Thanks. There is now no value in sending a video. Basically this has to be a Microsoft issue that can not be resolved via the current ClearWin+ coding (except by using the alternative mechanism).

7 Aug 2020 11:16 #26184

Paul,

With respect, I suggest that it might be worth keeping this one open, as others (not me, I might add) have noted this before. It may be a foible associated with anti-virus, or some other software, or just a setting within Windows. Whichever or whatever it is, it would be reassuring if the reason was known.

Eddie

7 Aug 2020 11:31 #26186

Eddie

I am not sure what you mean. I can't keep it open in the sense that an action is required from Silverfrost. This and similar posts will remain in place for guidance.

7 Aug 2020 12:25 #26187

Hi Paul,

You are dead right that it seems meaningless it keep it open on your 'to do' list, and right that the Forum keeps the topic open for others.

However, I think that it would be worth seeing Simon's video, and he shouldn't be dissuaded from showing it.

Eddie

7 Aug 2020 8:53 #26191

I was unsure how to video the problem, and it was suggested I try using Xbox. That showed me compiling the programme, but failed to show the actual application running. So I then tried to record just the application, but now the problem seems to have gone away! I have some of my users still reporting the same issue, so I will see if I can get one of them to video it, but I will of course use the window_option@ solution to avoid this issue in future releases.

Many thanks for your suggestions.

Please login to reply.