FUDforum - خوراک RDF
http://fudforum.org/forum/index.php
Trying to create a .bat file for windows using fwrite(
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=183658&th=123268#msg_183658
characters as another file that executes and looks the same except for this
the working file seems to have the type of newline characters
you would see in a word document (select it and you see a little
blank character area)
will using PHP_EOL solve my problem?
both files end up being properly recognized by the system as
batch files and both look the same in terms of content except for
the new line (i created my new line by using /r/n
Its not the same.
Thanks for any help.]]>scasti12013-11-07T00:07:33-00:00Re: Trying to create a .bat file for windows using fwrite(
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=183659&th=123268#msg_183659
scasti1@yahoo.com wrote:
^^^^^^^^^^^^^^^^^
Please fix.
> I can create the .bat file, but the resulting file does not have the same
> new line characters as another file that executes and looks the same
> except for this
>
> the working file seems to have the type of newline characters
> you would see in a word document (select it and you see a little
> blank character area)
The newline character sequence in WinDOS is <CR><LF>. It is therefore
natural that .bat files for Windows require this character sequence as they
are executed by a WinDOS program, COMMAND.COM or CMD.EXE.
> will using PHP_EOL solve my problem?
Only if it is PHP on Windows.
> both files end up being properly recognized by the system as
> batch files and both look the same in terms of content except for
> the new line (i created my new line by using /r/n
> Its not the same.
The proper escape sequence is "\r\n" (in double-quotes).
PointedEars
--
When all you know is jQuery, every problem looks $(olvable).]]>Thomas 'PointedEars' 2013-11-07T00:29:40-00:00Re: Trying to create a .bat file for windows using fwrite(
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=183662&th=123268#msg_183662
scasti1@yahoo.com wrote:
> I can create the .bat file, but the resulting file does not have the same new line
> characters as another file that executes and looks the same except for this
>
> the working file seems to have the type of newline characters
> you would see in a word document (select it and you see a little
> blank character area)
>
> will using PHP_EOL solve my problem?
>
> both files end up being properly recognized by the system as
> batch files and both look the same in terms of content except for
> the new line (i created my new line by using /r/n
> Its not the same.
>
> Thanks for any help.
>
When you create text based files for your local machine, you should make
sure that you open them in "text" mode, which will cause the library to
convert \n to whatever is needed for the local machine as a line ending.]]>Richard Damon2013-11-07T04:49:45-00:00Re: Trying to create a .bat file for windows using fwrite(
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=183666&th=123268#msg_183666
> I can create the .bat file, but the resulting file does not have the same new line
>
> characters as another file that executes and looks the same except for this
>
>
>
> the working file seems to have the type of newline characters
>
> you would see in a word document (select it and you see a little
>
> blank character area)
>
>
>
> will using PHP_EOL solve my problem?
>
>
>
> both files end up being properly recognized by the system as
>
> batch files and both look the same in terms of content except for
>
> the new line (i created my new line by using /r/n
>
> Its not the same.
>
>
>
> Thanks for any help.
My solution was to do a more normal set of batch commands rather a funky set that worked for some reason some time in the past and still did but could not be replicated with new iterations of creation for some reason. Since it wasn't working initially, I thought something else may be wrong. I did still use PHP_EOL but /r/n would have worked too I'm sure. Thanks for the help.]]>scasti12013-11-07T20:00:21-00:00