Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    HI FRIENDS,

    I have some files in a folder which I am opening it at runtime in my program.
    When i am opening the files some of the files do not open.
    Is there any issue with the files in open-c I am using fstream class.

    Thanks,
    himanshu k.
    Symbian Application Developer.

  2. #2
    Super Contributor paipeng's Avatar
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721
    what kind of error by opening the file?
    Symbian && Android && iPhoneOS

  3. #3
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    Hi friends,

    ------------------------------
    This is the following code:
    ------------------------------
    1) FILES CREATED.

    2)
    for (i = 0; i < wordsToRead; i++)
    {
    dicFile.read(&b_char,1); // IO OPERATION

    for(j = 0; j < b_char; j++)
    {
    dicFile.read((char*)&b_short, 2); // IO OPERATION
    }

    }

    3) AFTER THIS THE FILES ARE NOT CREATED.

    Thanks,
    himanshu k.
    symbian application developer.

  4. #4
    Super Contributor paipeng's Avatar
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721
    do you mean, files can't be opened or can't be created?!


    some kind of files or all files?
    Symbian && Android && iPhoneOS

  5. #5
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    hi friends,

    1)
    First of all the files cannot be created.

    2)
    Secondly what I tried is, I myself put the files(zero byte) into that folder, so now the code had to just open the files but that also is ot happening IT IS SETTING THE [fail bit] OF THE ios class.

    Thanks,
    himanshu k.
    Symbian Application Developer.

  6. #6
    Super Contributor paipeng's Avatar
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721
    Have you taken a look at the example in OpenC++?
    Symbian && Android && iPhoneOS

  7. #7
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    hi,

    I have executed that example also.

    See when i am reading only 1 record from the file, the further files are created,

    but when i do 30000 read operations on the file, the furthur files are not created.

    Is this an isue with open-C??

    Thanks,
    himanshu k
    Symbian Application Developer.

  8. #8
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    hi friends,

    I am having a problem with IO operations in open-c.

    This is the path:
    -----------------
    C:\Symbian\9.1\S60_3rd_MR\Epoc32\winscw\c\system\Apps\test\

    I am having 4 files say f1.txt (size 400 KB)
    f2.txt (1 kb)
    f3.txt (1 kb)
    f4.txt (1 kb)

    These four files reside in the following above given path.
    The files in the program are opened in binary mode.

    a) In the first case, I am reading the entire file (f1.txt)
    in a loop (it contains say 10000 records) i.e there are 10000 read operations
    (*) After that if i try to open files [f2.txt,f2.txt and f4.txt]
    it doesnt get opened even if they exists.

    b) In the second case, I am not reading te entire file but just
    1000 records i.e there are just 1000 read operations.

    In this case all the files i.e [f2.txt,f3.txt,f4.txt] are created.

    why is it that after 10000 read operations code doesnt work properly
    and after 1000 operations it works properly.

    Is there any limitation on the number of read operations or do i need any privilage for such extensive file operation.

    In both the cases the program doesnt crash it exits normally.

    I am in a reall fix. please do help me out.
    Eagerly waiting for your reply.

    Thanks,
    himanshu k.
    Symbian Application Developer.
    Last edited by himsymbian; 2008-07-03 at 10:19.

  9. #9
    Super Contributor paipeng's Avatar
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721
    try to use only one loop-function to read data from a file

    Code:
    or (i = 0; i < wordsToRead; i++)
    {
    dicFile.read(&b_char,1); // IO OPERATION
    
    for(j = 0; j < b_char; j++)
    {
    dicFile.read((char*)&b_short, 2); // IO OPERATION
    }
    
    }
    Symbian && Android && iPhoneOS

  10. #10
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    hi paipeng,

    Can you please explain in detail your solution!!

    Thanks,
    himanshu k
    symbian application developer

  11. #11
    Super Contributor paipeng's Avatar
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721
    something like normal read operation:


    "
    while( not to EOF)
    {
    file.read(buffer, length);
    }
    "
    Symbian && Android && iPhoneOS

  12. #12
    Regular Contributor himsymbian's Avatar
    Join Date
    Apr 2005
    Posts
    274
    hi paipeng,

    Thanks for your reply.
    I tried that but it didn't work.

    thanks again
    himanshu k
    Symbian Application Developer.

Similar Threads

  1. Trusted Application
    By damien_a in forum Mobile Java General
    Replies: 11
    Last Post: 2012-02-17, 20:49
  2. Problem with pyobfuscate
    By JOM in forum Python
    Replies: 3
    Last Post: 2008-06-20, 22:47
  3. open file from inbox
    By Essam-ag in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-06-19, 09:46
  4. Compilation error if i use CQikAppUi instead of CAknAppUi
    By sambasivarao.p in forum Symbian C++
    Replies: 3
    Last Post: 2005-10-12, 05:26
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved