Did you know ... | Search Documentation: |
![]() | Packs (add-ons) for SWI-Prolog |
Title: | Directory traversal module |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.5.11 |
SHA1 sum: | c8eb9904e74c2a1e67c21301605bfd76e0964515 |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.5.1 | af36a790fe1048a9936686809ca1d5c5a69400fa | 1 | https://github.com/xpxaxsxi/dpath/archive/0.5.1.zip |
0.5.2 | f5b0cfca40d0cf74872d1590c6dad3fc81dfa14f | 3 | https://github.com/xpxaxsxi/dpath/archive/0.5.2.zip |
0.5.8 | a461d5952ffea5deff1be647a743a63b2e4130fb | 6 | https://github.com/xpxaxsxi/dpath/archive/0.5.8.zip |
0.5.10 | abb69dace1acf549ac15c0864c851836f5d4a3f9 | 1 | https://github.com/xpxaxsxi/dpath/archive/0.5.10.zip |
0.5.11 | c8eb9904e74c2a1e67c21301605bfd76e0964515 | 12 | https://github.com/xpxaxsxi/dpath/archive/0.5.11.zip |
An file system traversing utility. Backtracks in the directory structure. Got inspiration from xpath/2.
This repository is under a MIT-license.
This repository can be installed to Swi-Prolog as a pack by pack_install(dpath).
?- directory_files('.',List). List=['file1.txt','file2.txt','file3.pl'].
?- exists_file('file1.txt'). %old way true.
?- file('file1.txt'). %the new way true.
?- file(A). A='file1.txt'; A='file2.txt'; A='file3.pl'
?- dpath:filetype(F.pl). %Swipl doesn't like the dot in 'F.pl' and the Do What I Mean % proposes a proper module in Windows. Linux throws a error F=file3
Linux example:
?- dir('/'/A/B/C/D/E/F). A = usr, B = include, C = 'c++', D = '4.7', E = ext, F = pb_ds
?- file('/'/A/B/'smb.conf'). A = etc, B = samba
dpathw
and wexplorer
are modules that interact with Windows File Explorer.
dpath
can be used without them, as in Linux command line.
Example:
Windows 10 opens up an Explorer window that has dpath.pl selected, when current directory has only one file: the dpath.pl file. If current directory has more prolog files then for each file a new Explorer windows is opened.
?- dpathw:wexplore(filetype(A.pl)). A = dpath .
Example:
Windows 10 opens an jpg-image. Next image is shown after user hits spacebar in Swi-Prolog command prompt. All desktops are traversed while searching for images.
?- dpathw:wopen(filetype('c:'/users/_/desktop/A.jpg)).
Example:
Windows 10 shows a slideshow of jpg-images from desktop-folder, every users desktop is searched
?- dpathw:wopen(filetype('c:'/users/_/desktop/A.jpg)), sleep(5), fail;!.
Possible bugs: Using Swi-Prolog dicts might cause problems.
Pack contains 7 files holding a total of 17.5K bytes.