Results 1 to 3 of 3

Thread: Creation and writing to .dat file using QFile on Windows some problem…

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Creation and writing to .dat file using QFile on Windows some problem…

    I’ve outputed :
    after

    Qt Code:
    1. QFile file(QDir::toNativeSeparators(outputDir + "/" + fileName));
    2. file.open(QFile::ReadWrite);
    To copy to clipboard, switch view to plain text mode 


    I’ve get: file.fileName() = “(path to file + file name BUT with separators “/” and not “\” as on Windows)”
    file.errorString() = “The parameter is incorrect”
    file.error() = 5 ( Error in opening file ).

    Why file.fileName() returns path name with “/” ( Linux like separators ) and not that of Windows “\\” or “\” ??
    Still can’t open file in rw directory?
    What is the problem?
    Thank you for your help.

  2. #2
    Join Date
    Jul 2010
    Posts
    72
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Creation and writing to .dat file using QFile on Windows some problem…

    Separators are “treated” automatically by Qt. I’ve changed file name for Windows and now it works.
    Thanks for your help. Solved.

Similar Threads

  1. Replies: 4
    Last Post: 9th May 2011, 09:52
  2. QFile resized files gets truncated after writing
    By MaximA in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 17:23
  3. Windows file handle on QFile?
    By Teerayoot in forum Qt Programming
    Replies: 4
    Last Post: 14th May 2007, 11:11
  4. problem in writing text with QFile
    By wei243 in forum Qt Programming
    Replies: 5
    Last Post: 6th March 2007, 14:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.