Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
2 Views

GETFILEINFOQQ files and/or directories?

On Windows, Does GETFILEINFOQQ with wildcard string return files only or files and directories?   If only files, is there a way to list directories with wild card matching?   

It seems DELFILESQQ may delete directories or not depending on the file system.  It seems to delete directories on a local disk but not on a network disk (Linux with SAMBA).  Or it may depend on something else.

thanks

scott

 

0 Kudos
3 Replies
Highlighted
Black Belt
2 Views

As the documentation says, it

As the documentation says, it will return directories - the FILE$INFO structure will have the FILE$DIR bit set.

I have read earlier that deleting files on network shares can be problematic. You may want to see if the Windows API routine DeleteFile works better for you.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
New Contributor I
2 Views

It seems like in initial

It seems like in initial testing, that GETFILEINFOQQ  with wild card input string does not seem to capture directories.

 

I have directories   junk   and jun11  and I try to get the files matching junk*.

The purpose is to recursively delete directories (could be wildcard syntax)  in Fortran.

On Windows 7;  using intel fortran 17.1.   I am also trying to get our code working on both Windows and Linux, both 17.1.

 

Some retirement Steve...

 

 

 

0 Kudos
Highlighted
Black Belt
2 Views

I took the documentation's

I took the documentation's example for GETFILEINFOQQ, built it and ran it, specifying a folder I had created with two subfolders and two files. Note that I used * as the wildcard and not *.*, which would exclude directories. The only change I made was to use A20 for the file name output format. Here's what I got:

 Enter wildcard of files to view: E:\Temp\*
 .                           0      D
 ..                          0      D
 File1.txt                   0     A
 File2.rtf                   7     A
 Folder1                     0      D
 Folder2                     0      D
Press any key to continue . . .

As you can see, it found the subdirectories as well as the hidden . and .. directories described in the documentation.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos