Announcement

Collapse
No announcement yet.

Writing a text file?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Writing a text file?



    This is probably incredibly easy and yet it is currently baffling me.

    I want to have my mivascript write out a simple text file. I want it
    to end up in the same folder where the script is. Normally, files
    are exported and end up in the data folder, I don't want it there.

    Sandy


    #2
    Writing a text file?



    You can use fscopy(source,destination) and then fdelete(source).

    Jonathan
    Driftwood Network Services


    At 03:46 PM 4/1/2005, Sandy Rozhon wrote:
    >This is probably incredibly easy and yet it is currently baffling me.
    >
    >I want to have my mivascript write out a simple text file. I want it
    >to end up in the same folder where the script is. Normally, files
    >are exported and end up in the data folder, I don't want it there.
    >
    >Sandy
    >

    Comment


      #3
      Writing a text file?



      or fsrename(source,destination)

      Ivo
      http://mivo.truxoft.com


      -----Original Message-----
      From: Jonathan - Driftwood

      You can use fscopy(source,destination) and then fdelete(source).

      Jonathan
      Driftwood Network Services




      Comment


        #4
        Writing a text file?



        You write the file using MvEXPORT to the data directory, then move it to
        the script directory.

        All the Miva Script command syntax is offered here:

        <A HREF ="http://www.miva.com/docs/api/index.html#script">http://www.miva.com/docs/api/index.html#script</A>

        Jonathan
        Driftwood Network Services


        At 03:58 PM 4/1/2005, Sandy Rozhon wrote:
        >On 1 Apr 2005 at 15:51, Jonathan - Driftwood wrote:
        >
        > > You can use fscopy(source,destination) and then fdelete(source).
        >
        >That will work to write out a text file? I will be creating the file
        >with mivascript and then need to write it out (save it) so that it is
        >available to another program.
        >
        >If it WILL work....what is my 'source' as noted in your line of code?
        >
        >Thanks,
        >Sandy



        Comment


          #5
          Writing a text file?



          Or use fsrename(source,destination)
          ----- Original Message -----
          From: "Jonathan - Driftwood" <[email protected]>
          To: "Sandy Rozhon" <[email protected]>; "Miva Userlist"
          <[email protected]>
          Sent: Friday, April 01, 2005 12:51 PM
          Subject: Re: [meu] Writing a text file?


          > You can use fscopy(source,destination) and then fdelete(source).
          >
          > Jonathan
          > Driftwood Network Services
          >
          >
          > At 03:46 PM 4/1/2005, Sandy Rozhon wrote:
          > >This is probably incredibly easy and yet it is currently baffling me.
          > >
          > >I want to have my mivascript write out a simple text file. I want it
          > >to end up in the same folder where the script is. Normally, files
          > >are exported and end up in the data folder, I don't want it there.
          > >
          > >Sandy
          > >

          Comment


            #6
            Writing a text file?



            All those old miva scripters expect you to know everything :)

            Here's a script example of how it works:

            Fill up a variable (in this example called l.export_data) with
            everything you want to export.

            Then export it to a file called some_file.txt like this:
            <MvEXPORT FILE = "{'some_file.txt'}" FIELDS = "l.export_data">

            Then you have to move the file from the data directory to your script
            directory, so do this:
            <MvASSIGN NAME = "l.ok" VALUE = "{
            fsrename('some_file.txt','some_file.txt') }">

            If you want to access it from your web site from a link or something,
            you need to change the file permissions to allow that to happen like this:
            <MvASSIGN NAME = "l.ok" VALUE = "{ schmod('some_file.txt','0755') }">

            Scot

            Sandy Rozhon wrote:
            > This is probably incredibly easy and yet it is currently baffling me.
            >
            > I want to have my mivascript write out a simple text file. I want it
            > to end up in the same folder where the script is. Normally, files
            > are exported and end up in the data folder, I don't want it there.
            >
            > Sandy
            >

            Comment


              #7
              Writing a text file?



              Actually, you should use 644, not 755. I don't think you
              want to make the file executable, just readable.

              /Scott

              --- Scot Ranney <[email protected]> wrote:
              > All those old miva scripters expect you to know
              > everything :)
              >
              > Here's a script example of how it works:
              >
              > If you want to access it from your web site from a link
              > or something,
              > you need to change the file permissions to allow that to
              > happen like this:
              > <MvASSIGN NAME = "l.ok" VALUE = "{
              > schmod('some_file.txt','0755') }">
              >
              > Scot
              >
              > Sandy Rozhon wrote:
              > > This is probably incredibly easy and yet it is
              > currently baffling me.
              > >
              > > I want to have my mivascript write out a simple text
              > file. I want it
              > > to end up in the same folder where the script is.
              > Normally, files
              > > are exported and end up in the data folder, I don't
              > want it there.
              > >
              > > Sandy
              > >

              __________________________________________________
              Do You Yahoo!?
              Tired of spam? Yahoo! Mail has the best spam protection around
              http://mail.yahoo.com

              Comment


                #8
                Writing a text file?



                Thanks to everyone who jumped in with help on this question.

                Sandy

                On 1 Apr 2005 at 15:46, Sandy Rozhon wrote:

                > This is probably incredibly easy and yet it is currently baffling me.
                >
                > I want to have my mivascript write out a simple text file. I want it
                > to end up in the same folder where the script is. Normally, files
                > are exported and end up in the data folder, I don't want it there.
                >
                > Sandy
                >

                Comment


                  #9
                  Writing a text file?



                  Normally the mivadata and web site are separated for security reasons in a
                  structure similar to this

                  /www/mivadata/
                  /www/html/

                  Using symbolic links or other methods (on linux/unix) it is possible to map
                  the html to "also" reside under the mivadata folder. Like this.

                  /www/mivadata/
                  /www/html/
                  /www/mivadata/html

                  The second html folder is just a re-mapping of the first. This lets your
                  mivascript application have full access the the website keeps the website
                  isolated from the mivadata.

                  Ray

                  -----Original Message-----
                  From: [email protected] [mailto:[email protected]] On Behalf
                  Of Sandy Rozhon
                  Sent: Friday, April 01, 2005 3:46 PM
                  To: Miva Userlist
                  Subject: [meu] Writing a text file?

                  This is probably incredibly easy and yet it is currently baffling me.

                  I want to have my mivascript write out a simple text file. I want it to end
                  up in the same folder where the script is. Normally, files
                  are exported and end up in the data folder, I don't want it there.

                  Sandy



                  Comment


                    #10
                    A way to add sizes of shirts to the shopping cart more easily



                    Hi, I am trying to improve my Miva wholesale store based on input
                    from a customer. We sell T-shirts, and currently the customer has to
                    enter 2 and select the size he wants, click buy, do again for the
                    next size, do again for the next size, and so on. There's a check box
                    for whether the customer wants the T-shirts bagged or not, which
                    resets itself every reload so the customer has to click it again with
                    each size.

                    What I'd much rather like to see is a way that the customer could
                    have different fields for each size, and he could just enter however
                    many of each size he wanted, then click buy and have all the items
                    added to the cart. Is something like this available? What are some
                    other alternate ways that customers can add 5 size L, 5 size XL, 3
                    size small, all at one time? Maybe something with check boxes?
                    --
                    ________________________________
                    J-LIST <A HREF ="http://www.jlist.com">http://www.jlist.com</A>
                    Thousands of unique products from Japan, from Hello Kitty toilet
                    paper to miniature sushi to our world-famous "I'm looking for a
                    Japanese girlfriend" T-shirts. Visit us now!

                    Interested in my life in Japan? See the Peter Payne homepage at
                    <A HREF ="http://www.peterpayne.net/">http://www.peterpayne.net/</A>

                    Comment


                      #11
                      A way to add sizes of shirts to the shopping cart more easily



                      Hi:

                      You're posting to the wrong list - please post to the
                      [email protected] list (if you are subscribed).

                      As for your question, though, you can do this using Product Page
                      Templates:
                      <A HREF ="http://www.designextend.com/page/miva/PROD/BROK_PRODTEMPLATES">http://www.designextend.com/page/miva/PROD/BROK_PRODTEMPLATES</A>

                      Pamela
                      Real Solutions for Miva Merchant
                      The Official Guide to Miva Merchant
                      <A HREF ="http://www.designextend.com/DE">http://www.designextend.com/DE</A>

                      > -----Original Message-----
                      > From: [email protected]
                      > [mailto:[email protected]] On Behalf Of Peter Payne
                      > Sent: Wednesday, April 20, 2005 5:40 AM
                      > To: Miva Userlist
                      > Subject: [meu] A way to add sizes of shirts to the shopping
                      > cart more easily
                      >
                      >
                      > Hi, I am trying to improve my Miva wholesale store based on input
                      > from a customer. We sell T-shirts, and currently the customer has to
                      > enter 2 and select the size he wants, click buy, do again for the
                      > next size, do again for the next size, and so on. There's a check box
                      > for whether the customer wants the T-shirts bagged or not, which
                      > resets itself every reload so the customer has to click it again with
                      > each size.
                      >
                      > What I'd much rather like to see is a way that the customer could
                      > have different fields for each size, and he could just enter however
                      > many of each size he wanted, then click buy and have all the items
                      > added to the cart. Is something like this available? What are some
                      > other alternate ways that customers can add 5 size L, 5 size XL, 3
                      > size small, all at one time? Maybe something with check boxes?
                      > --
                      > ________________________________
                      > J-LIST <A HREF ="http://www.jlist.com">http://www.jlist.com</A>
                      > Thousands of unique products from Japan, from Hello Kitty toilet
                      > paper to miniature sushi to our world-famous "I'm looking for a
                      > Japanese girlfriend" T-shirts. Visit us now!
                      >
                      > Interested in my life in Japan? See the Peter Payne homepage at
                      > <A HREF ="http://www.peterpayne.net/">http://www.peterpayne.net/</A>
                      >

                      Comment

                      Working...
                      X