Get folder names in directory

That is what i know :slight_smile: just asked that attachment name where it is failing pal :slight_smile:

Regards…!!
Aksh

1 Like

It is not failing but, i did not come with the right result, if i send the 2 attachement, it did not open theme, it only open the application adope, but when in receive one attachement it works rignt

1 Like

I had another issue, i’m using move file
but i got an error: could not found the directory
Main.xaml (11.0 KB)

please watch this

Hi,
I am trying to list the files of my storage but getting error as some of my files have unsupported characters in its name. can anyone tell me how to deal with this type error and how to bypass this error.

Thanks.

hi @Atul_Rai

Could you give some screenshots/copy here those unsupported characters?

Hi @loginerror
I have a UNIX based storage which accepts special characters such as :,[ ],*,? and more which are not supported in windows file system. eg. Huh? Cartoon.caf
I am scanning the whole storage to list all the files, their size, created date and last accessed date and path. Now I have 3 problems.

  1. Sometimes path of the file is more than length of string variable. i.e.255 characters. then the loop breaks and show the error.
  2. When I assign variable=system.io.directory.getfiles(my_path) then if the folder contains the files name which are not supported then it shows error.
  3. I have a folder named as Copy FROM local HDD it also shows the error. please confirm is it because if word “FROM” which is reserved in UiPath.

Could you maybe provide more information about the error messages you’ve received?

As far as 1. is concerned, the path length of 255 characters is a known Windows issue. We would still very much like to see the error for each situation.

Hi @loginerror

sorry for the late reply.
while execution some times I get argument exception and some times object reference not set to an instance error. Here is the details of the error

Message: Object reference not set to an instance of an object.

Exception Type: System.NullReferenceException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:

System.NullReferenceException: Object reference not set to an instance of an object.

at UiPath.Core.Activities.ForEach`1.Execute(NativeActivityContext context)

at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

every time it occurs for one of my folder which is mentioned in point 3.
I am creating a array of sub folder and then trying to iterate through all of them and list the files into them. As I can see while debuging that it is creating the array of sub folders but while starting with the 1st folder it gives me above error.

Please help me.

At which point is the array initialized and on which activity does the exception or error message happen? Having an example of the workflow would help a lot.

Simple way to get directories list inside a directory

Enjoy!!

2 Likes