×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    dynamically creating file..

    Hi All,

    I need to create file dynamically...
    For file creation I am using

    _LIT(KDesName,"c:\\System\\Apps\\testfolder\\new1.jpg");
    file.Create(fs,KDesName,EFileWrite);


    now the problem is to change the KDesName at runtime like new2,new3 and so on.

    I can format the _LIT but the problem is thatcreate method takes const TDES as second argument and the format function copies the data to buffer like TPtr8.

    Help me out.

    Regards

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: dynamically creating file..

    Hi,
    Well then you should try something like
    _LIT(KFileName,"c:\\System\\Apps\\testfolder\\new%02d");
    TFileName fileName;
    TInt number = 2;
    fileName.Format(KFileName, number);
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: dynamically creating file..

    No problem I would have done sth like this
    Code:
    _LIT(KPath,"c:\\System\\Apps\\testfolder\\");
    _LIT( KFileName,"new");
    _LIT( KExt,".jpg" );
    
    TInt count; // which you could increment at your will
    Now 
    TFileName fileName;
    fileName.Copy( KPath );
    fileName.Append( KFileName );
    fileName.AppendNum( count );
    fileName.Append( KExt );
    
    file.Create(fs,fileName,EFileWrite);
    Regards,
    Sriky

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: dynamically creating file..

    thx for the help guys.. :)

Similar Threads

  1. [moved] Theme Studio Error
    By TalJ in forum Themes/Carbide.ui
    Replies: 2
    Last Post: 2009-09-06, 03:39
  2. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Python
    Replies: 35
    Last Post: 2008-01-17, 09:12
  3. Error Carbide C++ creating the SIS file
    By Naco in forum Symbian C++
    Replies: 3
    Last Post: 2007-03-14, 22:57
  4. Replies: 3
    Last Post: 2007-03-07, 03:36
  5. Creating image file from bitmap.
    By mahavirjain in forum Symbian C++
    Replies: 3
    Last Post: 2006-06-13, 06:48

Posting Permissions

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