Ne Ruby Dosya.modları ve seçenekleri açık mı? | Netgez.com
SORU
10 EYLÜL 2010, Cuma


Ne Ruby Dosya.modları ve seçenekleri açık mı?

Ruby File.open bağımsız olarak modları ve seçenekleri alır. Nerede modları ve seçenekleri tam bir liste bulabilirim?

CEVAP
10 EYLÜL 2010, Cuma


Ruby IO module documentation, sanırım.

Mode |  Meaning
----- --------------------------------------------------------
"r"  |  Read-only, starts at beginning of file  (default mode).
----- --------------------------------------------------------
"r " |  Read-write, starts at beginning of file.
----- --------------------------------------------------------
"w"  |  Write-only, truncates existing file
     |  to zero length or creates a new file for writing.
----- --------------------------------------------------------
"w " |  Read-write, truncates existing file to zero length
     |  or creates a new file for reading and writing.
----- --------------------------------------------------------
"a"  |  Write-only, starts at end of file if file exists,
     |  otherwise creates a new file for writing.
----- --------------------------------------------------------
"a " |  Read-write, starts at end of file if file exists,
     |  otherwise creates a new file for reading and
     |  writing.
----- --------------------------------------------------------
 "b" |  Binary file mode (may appear with
     |  any of the key letters listed above).
     |  Suppresses EOL <-> CRLF conversion on Windows. And
     |  sets external encoding to ASCII-8BIT unless explicitly
     |  specified.
----- --------------------------------------------------------
 "t" |  Text file mode (may appear with
     |  any of the key letters listed above except "b").

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • 24 Канал

    24 КанаÐ

    5 ÅžUBAT 2006
  • TheDroidDemos

    TheDroidDemo

    15 ÅžUBAT 2011
  • TWiT Netcast Network

    TWiT Netcast

    27 EKİM 2005