www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - String and listdir usage

reply GS Tan <sing_nep yahoo.com> writes:
Hi,

I am new to D and trying out how to program in D. I am familiar with C and I am
now trying out D.

I changed a file example from std.file for listdir and allows user to NOT
specific path and in which the program will check if a path has been entered.
If not, it will prompt user for the path. I have not been able to get it to
work properly. I am trying to get used to D for key input. WOuld you pls help
to explain why, though when readln can read the input string, it cannot pass
the information to listdir to return the directory listing.

Thanks for your help and attention.
Jan 10 2008
parent reply Jason House <jason.james.house gmail.com> writes:
GS Tan wrote:

 Hi,
 
 I am new to D and trying out how to program in D. I am familiar with C and
 I am now trying out D.
 
 I changed a file example from std.file for listdir and allows user to NOT
 specific path and in which the program will check if a path has been
 entered. If not, it will prompt user for the path. I have not been able to
 get it to work properly. I am trying to get used to D for key input. WOuld
 you pls help to explain why, though when readln can read the input string,
 it cannot pass the information to listdir to return the directory listing.
 
 Thanks for your help and attention.

I recommend you post your closest attempt (and maybe use D.learn newsgroup)
Jan 10 2008
next sibling parent GS Tan <sing_nep yahoo.com> writes:
Content-Type: text/plain

Jason House Wrote:

 GS Tan wrote:
 
 Hi,
 
 I am new to D and trying out how to program in D. I am familiar with C and
 I am now trying out D.
 
 I changed a file example from std.file for listdir and allows user to NOT
 specific path and in which the program will check if a path has been
 entered. If not, it will prompt user for the path. I have not been able to
 get it to work properly. I am trying to get used to D for key input. WOuld
 you pls help to explain why, though when readln can read the input string,
 it cannot pass the information to listdir to return the directory listing.
 
 Thanks for your help and attention.

I recommend you post your closest attempt (and maybe use D.learn newsgroup)

Thanks for the link. If you could pls take a look at my code and show me what is wrong. I have read through the tutorial and many does not address certain functions. The D language spec is on the spec so little examples. Thanks for the reply and compiling and running it. Listdir will only work if a path is specified at the command prompt but not when read from stdin using readln. Regards..GS
Jan 13 2008
prev sibling parent GS Tan <sing_nep yahoo.com> writes:
Content-Type: text/plain

Jason House Wrote:

 GS Tan wrote:
 
 Hi,
 
 I am new to D and trying out how to program in D. I am familiar with C and
 I am now trying out D.
 
 I changed a file example from std.file for listdir and allows user to NOT
 specific path and in which the program will check if a path has been
 entered. If not, it will prompt user for the path. I have not been able to
 get it to work properly. I am trying to get used to D for key input. WOuld
 you pls help to explain why, though when readln can read the input string,
 it cannot pass the information to listdir to return the directory listing.
 
 Thanks for your help and attention.

I recommend you post your closest attempt (and maybe use D.learn newsgroup)

Thanks for the link. If you could pls take a look at my code and show me what is wrong. I have read through the tutorial and many does not address certain functions. The D language spec is on the spec so little examples. Thanks for the reply and compiling and running it. Listdir will only work if a path is specified at the command prompt but not when read from stdin using readln. Regards..GS
Jan 13 2008