FAQ Database Discussion Community

Java dir/files list

I am trying to list all directories and files within a certain directory, but while "D:\data" works, "D:\" doesn't. "D" is a secondary disk. This is the exception: Exception in thread "main" java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:203) at java.util.Arrays$ArrayList.<init>(Arrays.java:3813) at java.util.Arrays.asList(Arrays.java:3800) at project.1.scavenger.listf(scavenger.java:19) at project.1.scavenger.listf(scavenger.java:30) at project.1.scavenger.listf(scavenger.java:30) at...

JSF render dir=“rtl” when language is arabic

I want to render the text direction rtl (Right-To-Left) in an inputText when the browser's Accept-Language is arabic in my JSF application. When Accept-Language is english the text introduced by the user would be dir="ltr" (Left-To-Right). How can I do it?

VBA Directory File Search using list within Excel

I'm currently trying to edit a macro a colleague of mine currently uses, the script currently opens a message box that allows you to enter in a string, which is then searched for and results are pasted into the workbook. I would like to change this so it searches for...

how to use loop to get values in dir()?

Why i can't get the values in the items in dir() with loop: for item in dir(): print(item) It just print __builtins__ __doc__ __loader__ __name__ __package__ __spec__ So, how can i use loop to print the value in item, i.e "__main__" in __name__ Thanks!...

process a list with specific name and extension in matlab

I'm trying to process a list of files that start with the same string, but only the .mat files. In my folder I have log files with names such as: CADS3P5Ph1_LKS_20141210_EVAL_103443_001.avi CADS3P5Ph1_LKS_20141210_EVAL_103443_001_MeasData.mat CADS3P5Ph1_LKS_20141210_EVAL_103443_002.avi CADS3P5Ph1_LKS_20141210_EVAL_103443_002_MeasData.mat CADS3P5Ph1_LKS_20141210_EVAL_103443_003.avi CADS3P5Ph1_LKS_20141210_EVAL_103443_003_MeasData.mat CADS3P5Ph1_LKS_20141210_EVAL_104236_001.avi CADS3P5Ph1_LKS_20141210_EVAL_104236_001_MeasData.mat I...

list directory and display details of each file. owner, octal permissions and filename using c

I'm trying to create a method that will do some system calls. It should display the owner of and octal code of each file. but somehow I cant get going. It displays the logged in user name as owner of each file listContents(char * dir) { struct dirent *direntp; DIR...

Saying there are 0 arguments when I have 2? Trying to open a CSV file to write into

I'm trying to read from a CSV file and codify people into groups using an equation. I append the name of their group they fall into to the end of the array that their row creates. Then I write it to a new file so I don't overwrite the original...

dir and filesep matlab

I am trying to find a list of jpg files but also using filesep (to break the names of the files) in one line dir([folder,[filesep '*.' 'jpg']]). The above command works for me. But I also want to find the files that include in their name a specific word like...

Build address for a local file in Matlab

I have some local files and I want to run my program on another pc without changing all addresses. C:\Users... is a local address on my pc. When I run it in another pc it gives me error. Actually I have to change every single address in other PCs and...