Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create .bin file?

How to create .bin file?

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 4 Posters 8.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JonBJ JonB

    @Vijaykarthikeyan
    I don't know whether there is a question here? You have not heeded the suggestion to use QStandardPaths to generate the file paths, and you have ignored that you need the Text flag as you are under Windows so the files generated will not be "proper" for Windows.

    V Offline
    V Offline
    Vijaykarthikeyan
    wrote on last edited by
    #10

    @JonB No..just know I've gone through the Qstandard page. For the question about the data format which @jsulm asked, I've replied with the full code. need to respect his time and words. that's why.. And thank you for your suggestion that qrc is read only and directed me to go for QStandardPath.

    jsulmJ 1 Reply Last reply
    0
    • JonBJ JonB

      @Vijaykarthikeyan said in How to create .bin file?:

      I wonder Why?

      Have you read up what Qt resource files are and where they are stored? They are embedded into your executable. They can be read at runtime, but you cannot write to them!

      A log file will need to be a real, external file in your file system. You can use QStandardPaths to help generate a path to a suitable directory, in a cross-platform manner.

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on last edited by
      #11

      @JonB Is that .xml created automatically in executable? Because,in exe folder, there are only file formats like .dat and .pak?

      JonBJ 1 Reply Last reply
      0
      • V Vijaykarthikeyan

        @JonB Is that .xml created automatically in executable? Because,in exe folder, there are only file formats like .dat and .pak?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #12

        @Vijaykarthikeyan
        What .xml file? There is no mention of any in your code. Nor do I know what .dat or .pak files are doing in your "exe folder".

        V 1 Reply Last reply
        0
        • V Vijaykarthikeyan

          @JonB No..just know I've gone through the Qstandard page. For the question about the data format which @jsulm asked, I've replied with the full code. need to respect his time and words. that's why.. And thank you for your suggestion that qrc is read only and directed me to go for QStandardPath.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #13

          @Vijaykarthikeyan said in How to create .bin file?:

          I've replied with the full code

          It would be good if you would answer the questions. Also, in the code you posted I don't see anything related to writing .bin file, so no idea how that should help us...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          V 1 Reply Last reply
          1
          • JonBJ JonB

            @Vijaykarthikeyan
            What .xml file? There is no mention of any in your code. Nor do I know what .dat or .pak files are doing in your "exe folder".

            V Offline
            V Offline
            Vijaykarthikeyan
            wrote on last edited by
            #14

            @JonB You have said to look-through Qt Resource System.In that they have mentioned .qrc file which is the .xml format where all the resource files located. That's why I have asked about it.

            jsulmJ 1 Reply Last reply
            0
            • V Vijaykarthikeyan

              @JonB You have said to look-through Qt Resource System.In that they have mentioned .qrc file which is the .xml format where all the resource files located. That's why I have asked about it.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #15

              @Vijaykarthikeyan said in How to create .bin file?:

              Qt Resource System.In that they have mentioned .qrc file which is the .xml format where all the resource files located.

              The resource file itself is in XML format. But there will be no such file in the build folder. Resource files are built INTO the executable (I already mentioned that in this thread). So, don't know why you expect to see any .xml files in build folder...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • jsulmJ jsulm

                @Vijaykarthikeyan said in How to create .bin file?:

                I've replied with the full code

                It would be good if you would answer the questions. Also, in the code you posted I don't see anything related to writing .bin file, so no idea how that should help us...

                V Offline
                V Offline
                Vijaykarthikeyan
                wrote on last edited by
                #16

                @jsulm That's where I'm getting struck. I don't know how to create it. Then,you have asked what format. I have mentioned that it's a string format

                jsulmJ JonBJ 2 Replies Last reply
                0
                • V Vijaykarthikeyan

                  @jsulm That's where I'm getting struck. I don't know how to create it. Then,you have asked what format. I have mentioned that it's a string format

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #17

                  @Vijaykarthikeyan said in How to create .bin file?:

                  I have mentioned that it's a string format

                  So, basically a text file?
                  Then what exactly is the problem?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  V 1 Reply Last reply
                  0
                  • V Vijaykarthikeyan

                    @jsulm That's where I'm getting struck. I don't know how to create it. Then,you have asked what format. I have mentioned that it's a string format

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #18

                    @Vijaykarthikeyan
                    It is hard to understand what your question or issue is. But again a reminder: if you are wanting to write to a log file at runtime you won't be able to use a qrc: for this, so why are we even discussing such a file?

                    V 2 Replies Last reply
                    1
                    • J.HilkJ J.Hilk

                      @Vijaykarthikeyan said in How to create .bin file?:

                      @JonB Yes.you are correct. Writing into other directory it works. I wonder Why?

                      @JonB said in How to create .bin file?:

                      they are read-only

                      @Vijaykarthikeyan said in How to create .bin file?:

                      Now, If I want to run my software in any other target system, it is not sure that those systems have same directory which I have coded in my file? What is the solution?

                      https://doc.qt.io/qt-6/qstandardpaths.html

                      V Offline
                      V Offline
                      Vijaykarthikeyan
                      wrote on last edited by
                      #19

                      @J-Hilk Thank you so much. Yes, it is possible through QStandardPath .

                      1 Reply Last reply
                      1
                      • JonBJ JonB

                        @Vijaykarthikeyan
                        It is hard to understand what your question or issue is. But again a reminder: if you are wanting to write to a log file at runtime you won't be able to use a qrc: for this, so why are we even discussing such a file?

                        V Offline
                        V Offline
                        Vijaykarthikeyan
                        wrote on last edited by
                        #20

                        @JonB I understand why it can't be? Again thank you for suggesting another problem which is writing a file through QStandarPath.

                        1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @Vijaykarthikeyan said in How to create .bin file?:

                          I have mentioned that it's a string format

                          So, basically a text file?
                          Then what exactly is the problem?

                          V Offline
                          V Offline
                          Vijaykarthikeyan
                          wrote on last edited by
                          #21

                          @jsulm I have written into the .txt format and .csv format and I had a doubt about creating .bin format. Then you all cleared my doubt it's worth nothing written into bin file. So, the problem solved and my doubt is cleared now

                          1 Reply Last reply
                          0
                          • V Vijaykarthikeyan has marked this topic as solved on
                          • JonBJ JonB

                            @Vijaykarthikeyan
                            It is hard to understand what your question or issue is. But again a reminder: if you are wanting to write to a log file at runtime you won't be able to use a qrc: for this, so why are we even discussing such a file?

                            V Offline
                            V Offline
                            Vijaykarthikeyan
                            wrote on last edited by
                            #22

                            @JonB Thank you.. I followed QStandardPath and tested in different target systems. It is able to create and write into the files independent of directories

                            1 Reply Last reply
                            1

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved