×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    file issues in open C

    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
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: file issues in open C

    what kind of error by opening the file?
    Symbian && Android && iPhoneOS

  3. #3
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: file issues in open C

    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
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: file issues in open C

    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
    Join Date
    Apr 2005
    Posts
    274

    Re: file issues in open C

    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
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: file issues in open C

    Have you taken a look at the example in OpenC++?
    Symbian && Android && iPhoneOS

  7. #7
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: file issues in open C

    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
    Join Date
    Apr 2005
    Posts
    274

    Question Re: file issues in open C

    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
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: file issues in open C

    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
    Join Date
    Apr 2005
    Posts
    274

    Re: file issues in open C

    hi paipeng,

    Can you please explain in detail your solution!!

    Thanks,
    himanshu k
    symbian application developer

  11. #11
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: file issues in open C

    something like normal read operation:


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

  12. #12
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: file issues in open C

    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 Symbian
    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. 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
  •