directory-browsing

Is there a way to glob() only files?

流过昼夜 提交于 2019-12-18 12:45:43
问题 I know that glob can look for all files or only all directories inside a folder : echo "All files:\n"; $all = glob("/*"); var_dump($all); echo "Only directories\n"; $dirs = glob("/*", GLOB_ONLYDIR); var_dump($dirs); But I didn't found something to find only files in a single line efficiently. $files = array_diff(glob("/*"), glob("/*", GLOB_ONLYDIR)); Works well but reads directory twice (even if there are some optimizations that make the second browsing quicker). 回答1: I finally found a

Assembly code support in source insight

99封情书 提交于 2019-12-12 21:17:13
问题 Has anybody tried browsing assembly language file (filename.s) in source insight? I just added whole Linux kernel project into source insight but it does not support any of the assembly files. 回答1: In The File field -> Load file -> Browse [give path]-> File Type [make it as all] Then you will find your ".s" file open it , You can use it like normal files 回答2: When you create the project in Sourceinsight, it adds all the types of files (like *.c, *.h, *.cpp, etc) it knows. It also adds

list partitions in nodejs

佐手、 提交于 2019-12-04 11:49:21
问题 I would like to get the list of partitions in windows, using nodejs. fs.readdir works fine for any folder below or including C:, but I cant figure out what to give it to have the list of partitions like "C:", "D:" and so on. Anyone know what I should use? 回答1: There is no api in node.js to list partitions. One workaround is to use child_process and execute wmic command (or any command which can list partitions). var spawn = require('child_process').spawn, list = spawn('cmd'); list.stdout.on(

list partitions in nodejs

橙三吉。 提交于 2019-12-03 08:14:48
I would like to get the list of partitions in windows, using nodejs. fs.readdir works fine for any folder below or including C:, but I cant figure out what to give it to have the list of partitions like "C:", "D:" and so on. Anyone know what I should use? There is no api in node.js to list partitions. One workaround is to use child_process and execute wmic command (or any command which can list partitions). var spawn = require('child_process').spawn, list = spawn('cmd'); list.stdout.on('data', function (data) { console.log('stdout: ' + data); }); list.stderr.on('data', function (data) {

How to enable Directory browsing by default on IIS Express

时光怂恿深爱的人放手 提交于 2019-12-03 05:06:22
问题 Cassini (Visual Studio development web server) by default enables directory browsing, how can I enable directory browsing on IIS Express by default? (I don't want to have a separate configuration for each project I have? 回答1: You should be able to use AppCmd.exe to manage IIS Express. Try this: appcmd set config /section:directoryBrowse /enabled:true More info on AppCmd.exe here: http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe 回答2: Go to Web.config file of your project. Add

Is there a way to glob() only files?

元气小坏坏 提交于 2019-11-30 07:53:43
I know that glob can look for all files or only all directories inside a folder : echo "All files:\n"; $all = glob("/*"); var_dump($all); echo "Only directories\n"; $dirs = glob("/*", GLOB_ONLYDIR); var_dump($dirs); But I didn't found something to find only files in a single line efficiently. $files = array_diff(glob("/*"), glob("/*", GLOB_ONLYDIR)); Works well but reads directory twice (even if there are some optimizations that make the second browsing quicker). Alain Tiemblo I finally found a solution : echo "Only files\n"; $files = array_filter(glob("/*"), 'is_file'); var_dump($files); But