×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    7

    File listing using emulator << possible?

    Hi everyone

    I am having problems with listing file names using the RFs/CDir API, but it seems that the emulator isn't running properly.

    The code I have to list all all file names within a folder is:

    CDir* dirList;
    _LIT(KDirName, "C:\Test\");
    _LIT(KFileSpec,"C:\Test\*");

    fileSession.Connect();

    User::LeaveIfError(
    fileSession.GetDir(KFileSpec,
    KEntryAttMaskSupported,
    ESortByName,
    dirList));

    It failed to run the line User::LeaveIfError and hence no file names were returned in variable dirList.

    My question is, can we actually use emulator to test the folder/file accessing on a pc? If so, what have I done wrong to result in such failure?

    Thanks for anyone in advance that could offer some help

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    maybe you should have checked the SDK docs on the topic, one problem there is that the dir name should have been written like this: _LIT(KDirName, "C:\\Test\\"); (i.e '\' in doubles.), same goes with the other string as well.

    Also next time, try to include the error note shown, because it tells exactly what goes wrong, and improves your possibilities of people answering your questions.

    yucca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×