Folder Item From A File Name

I need to create a folderItem for a file passed to my program via the command line. It is an existing file so I need code to specify the file using jus the file name so I can then read the data in. Thanks!

You can use the constructor to create a FolderItem from a path. I’m assuming you know how to read the arguments, correct? (If not, just ask!)

FolderItem Constructor(Path as String, Mode as PathMode)

var fTarget as new FolderItem(sPath, FolderItem.PathModes.TheMatchingPathMode)

Thanks for the reply … I’m still having problems with the code. There is no “TheMatchingPathMode”, I believe you meant Shell or perhaps absolutepath? I either case the code doesn’t run.

Yes, you were meant to change that to the appropriate PathMode. I provided a link to the documentation so that you may learn more about this constructor if you needed to. The PathModes are available from there.

Thanks Tim, That did it. It was looking for Native as a PathMode.

You may run into problems if the file name contains a space.