Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


BasicSession: hello file server

[Top]


Example code

Found in: examples\Base\FileServer\BasicSession

The files reproduced here are the main files contained in the examples directory. Some extra files may be needed to run the examples, and these will be found in the appropriate examples directory.

// BasicSession.cpp
//
// Copyright (C) Symbian Software Ltd 2000-2005.  All rights reserved.

// This example opens the file server session, and prints 
//"Hello File Server!" to the console.
// Used as the basis of all F32 examples

// Note that no data is written.

#include "CommonFramework.h"
#include <f32file.h>
    

LOCAL_D RFs fsSession;

// start of real example

LOCAL_C void doExampleL()
    {
    // open file server session
    User::LeaveIfError(fsSession.Connect()); // connect session
    // say hello
    _LIT(KGreeting,"Hello File Server!\n");
    console->Printf(KGreeting);
    fsSession.Close(); // close file server session
    }
// BasicSession.mmp
//
// Copyright (C) Symbian Software Ltd 2000-2005.  All rights reserved.

// using relative paths for source and userinclude directories

// No explicit capabilities required to run this.

TARGET        BasicSession.exe
TARGETTYPE    exe
UID           0
VENDORID 0x70000001

SOURCEPATH    .
SOURCE        BasicSession.cpp

USERINCLUDE   .
USERINCLUDE   ..\..\CommonFramework
SYSTEMINCLUDE \Epoc32\include

LIBRARY       euser.lib efsrv.lib

CAPABILITY    None
// BLD.INF
// Component description file
//
// Copyright (C) Symbian Software Ltd 2000-2005.  All rights reserved.

PRJ_MMPFILES

BasicSession.mmp

[Top]


Description

BasicSession connects to and disconnects from the file server (and prints “Hello File Server!” to the console).

[Top]


Classes used