- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Fortran application read industrial parameters from a database, stores classified data into a set of newly generated files. If there is no a specific type of parameters, the correspondent output file will be empty. I hope to delete those empty files in the end of execution. Is there any easy way to identify files with size of 0 KB and delete them?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ease may depend on what additional tools you are willing to use. Attempting to purge 0 size files purely in Fortran is likely to be clumsy, particularly if you haven't kept a list of the file names. Best choices might be between invoking a script, which could be run from CALL SYSTEM(), or Windows API calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use GETFILEINFOQQ with a wildcard file specification to get the info for each file created, and look at the LENGTH value to find the zero-length files. You can then call DELETEFILEQQ for the file.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page