General

Reply
Accepted Solution

Directory.GetFiles() exception

I got this line :

string[] feedsFiles = Directory.GetFiles("/Application/feeds", "*.txt");

 In my project I have the folder 'feeds' with soms .txt files in it.

But when I try to run it, I get an exception :

Unhandled Exception: System.IO.DirectoryNotFoundException: Directory '/Application/feeds' not found.

 

I'm I doing something wrong here?

Please use plain text.

Re: Directory.GetFiles() exception

I'm guessing the folder doesn't exist because you've not told PS Suite to copy your .txt files to the output directory. By default it won't know what to do with .txt files and will ignore them (and hence not create your feeds directory or copy them to the program location).

 

Right click the txt files and go Quick Properties -> Copy to Output Directory. I think that should fix it.

Martin Caine
Founder and Lead Programmer of Retroburn Game Studios

Twitter | LinkedIn | Facebook
Please use plain text.

Member

Member
f_prg
Posts: 1
Registered: ‎30-12-2011
Message 3 of 5 (196 Views)

Re: Directory.GetFiles() exception

What is File Build Action?

Is Build Action "None"?

Please Change to 'Content'!

Please use plain text.

Re: Directory.GetFiles() exception

Thanks. This helped me!
Please use plain text.

Re: Directory.GetFiles() exception

Thanks. This helped me together with MartinCaine his suggestion!
Please use plain text.
This widget could not be displayed.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。






Recent News