I need to open a file without knowing its extension in powerbuilder 12.6. I already have the path without extension file. Example : Path/file(no extension)
Asked
Active
Viewed 372 times
0
-
Do you mean there is no extension at all or there is one but do not know it.? In the latter case, what if several files have the same name but different extension (file.txt, file.jpg, file.csv,...)? – Marc Vanhoomissen Jul 14 '20 at 13:59
1 Answers
1
I found the solution to my problem. I only have the string that contains the path and the name of the file(without extension). For example: path = "C:APPLICATIONS/FOLDER1", FILENAME = "TEST123" So, the function dirlist can search inside the directory defined and store that coincidence(s) in a listbox. listbox1.dirlist(path + "" + filename + "") This function search all the coincidences inside the path with the filename specified and stores in the listbox. It works as the "%" + @stringtofind + "%" in sql. Then, it is simple to search your full filename (with the extension) in the listbox. Finally, use execute shell function choosing your full filename.

Cristhopher Mancilla
- 397
- 2
- 4
- 11