Loading ...
Sorry, an error occurred while loading the content.
 

Rewrite files

Expand Messages
  • nomp_e
    Hello all Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different
    Message 1 of 5 , Jun 1, 2012
      Hello all
      Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different place.
      Thanks Nomps
    • Rod
      Answering that accurately might take a bit of research. Why does it matter to you? Most folks don t care and the OS does not seem to encourage or offer such
      Message 2 of 5 , Jun 1, 2012
        Answering that accurately might take a bit of research. Why does it matter to you? Most folks don't care and the OS does not seem to encourage or offer such functionality.

        --- In libertybasic@yahoogroups.com, "nomp_e" <libnomps@...> wrote:
        >
        > Hello all
        > Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different place.
        > Thanks Nomps
        >
      • Stefan Pendl
        ... The file system drivers are not very optimized for Windows. In general increasing the size of the file will allocate additional blocks on disk, but they
        Message 3 of 5 , Jun 1, 2012
          Am 01.06.2012 18:08, schrieb nomp_e:
          > Hello all
          > Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different place.
          > Thanks Nomps
          >

          The file system drivers are not very optimized for Windows.

          In general increasing the size of the file will allocate additional
          blocks on disk, but they don't need to be contiguous.

          Decreasing the size of a file will mark the now unused blocks as free.

          Both situations will result in file system fragmentation.

          Check out
          http://msdn.microsoft.com/en-us/library/aa364407%28VS.85%29.aspx for the
          full story.


          --
          Stefan Pendl
          http://stefanpendl.runbasichosting.com/

          LB 4.04 Pro ... http://www.libertybasic.com/assist.html
          LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

          LB Community Wiki .............. http://basic.wikispaces.com/
          LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
          LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

          Books at http://www.lulu.com/ and http://www.amazon.com/
          Alyce Watson ... APIs for Liberty BASIC
          Carl Gundel .... Beginning Programming with Liberty BASIC

          Windows 7 Home Premium 64-bit SP1
          AMD Turion X2 RM-70 2GHz, 4GB RAM
        • Harry
          When you OPEN a file, the file will be opened in the path you specify with the file name in the OPEN command -- or in the default directory (the value of
          Message 4 of 5 , Jun 2, 2012
            When you OPEN a file, the file will be opened in the path you specify with the file name in the OPEN command -- or in the default directory (the value of DefaultDir$), if you don't specify a path in the OPEN command. Regardless, as long as you keep that file open, whenever you use print #h or put #h to write data to the file, the file will remain in the same location.

            If you use FILEDIALOG to specify the file to open, and use the filename variable you used in the FILEDIALOG command to OPEN the file, then, again, as as long as you keep that file open, whenever you use print #h or put #h to write data to the file, the file will remain in the same location.

            If you close the file, and open a file again to write data to it, you have to re-open same using the same filename and path you last wrote it to.

            That is, Microsoft doesn't do anything with your LB-created and modified files; you write your LB program to do with a file what you want to do with it.

            If you're not talking about files created/opened/modified in a program you're writing with LB, then it depends on the application you're talking about. Most applications, by default, including LB with respect to your LB source code, write a file back to the same location you opened it from unless you specify a different location with a Save As function or configure the application to do otherwise.

            --- In libertybasic@yahoogroups.com, "nomp_e" <libnomps@...> wrote:
            >
            > Hello all
            > Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different place.
            > Thanks Nomps
            >
          • Nomps E
            Hello Harry Thanks for your informative reply. That was what I was hoping. As I said im my reply to Richard, I am hoping to create a data destroying app for my
            Message 5 of 5 , Jun 3, 2012
              Hello Harry
              Thanks for your informative reply. That was what I was hoping. As I said im my reply to Richard, I am hoping to create a data destroying app for my own use. Your information means that the project is feasible
              Thanks againNomps.

              To: libertybasic@yahoogroups.com
              From: harrybee99@...
              Date: Sat, 2 Jun 2012 20:33:31 +0000
              Subject: [libertybasic] Re: Rewrite files


























              When you OPEN a file, the file will be opened in the path you specify with the file name in the OPEN command -- or in the default directory (the value of DefaultDir$), if you don't specify a path in the OPEN command. Regardless, as long as you keep that file open, whenever you use print #h or put #h to write data to the file, the file will remain in the same location.



              If you use FILEDIALOG to specify the file to open, and use the filename variable you used in the FILEDIALOG command to OPEN the file, then, again, as as long as you keep that file open, whenever you use print #h or put #h to write data to the file, the file will remain in the same location.



              If you close the file, and open a file again to write data to it, you have to re-open same using the same filename and path you last wrote it to.



              That is, Microsoft doesn't do anything with your LB-created and modified files; you write your LB program to do with a file what you want to do with it.



              If you're not talking about files created/opened/modified in a program you're writing with LB, then it depends on the application you're talking about. Most applications, by default, including LB with respect to your LB source code, write a file back to the same location you opened it from unless you specify a different location with a Save As function or configure the application to do otherwise.



              --- In libertybasic@yahoogroups.com, "nomp_e" <libnomps@...> wrote:

              >

              > Hello all

              > Does anyone know whether a file is written back to its same place on the disc after it has been altered or does Microsoft put it back in a different place.

              > Thanks Nomps

              >




















              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.