Tag:File operation

  • Implementation of File Operation and Network Request in Scala

    Time:2019-10-8

    1. Read data for each line in the file def main(args: Array[String]): Unit = { // pay attention to the encoding format of the file. If the encoding format is not correct, read the wrong report. val file: BufferedSource = Source.fromFile(“F:\\files\\file.txt”,”GBK”); val lines: Iterator[String] = file.getLines() for(line <- lines){ println(line) } // Pay attention to […]

  • MFC file operation method for creating files of CFile class

    Time:2019-9-29

    MFC file operation class CFile Several constructors of CFile class CFile (); // Constructor with no parameters. CFile (int hFile); // Constructor with file handle parameters. CFile( LPCTSTR lpszFileName, // File Path to Open UINT nOpenFlage//Sharing and Access Mode when Opening Files ) Constructor with file path and open mode In addition to opening a […]

  • Summary of Perl File Operation

    Time:2019-9-15

    I. Open and Close Documents The return value of open is used to determine whether the operation of opening a file succeeds, returns a non-zero value when it succeeds, and returns zero when it fails, so the following judgment can be made:    if (open(MYFILE, “myfile”))     {        # here is what to do if the […]

  • Usual File Operating Methods in Ruby

    Time:2019-9-4

    I. New Documents Copy codeThe code is as follows:     f=File.new(File.join(“C:”,”Test.txt”), “w+”)     f.puts(“I am Jack”)     f.puts(“Hello World”) File mode “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 […]

  • FreeBSD File Operation

    Time:2019-6-2

    0.        PrefaceThe operation of files is the most commonly used instruction. It includes switching directories, listing files, establishing files, deleting files, copying files, renaming files, file permissions, file links, etc. 1. Toggle directoryDirective: CD (change diretory changes directory location of account)Syntax: CDdirectory_name   Parameter:. Represents the current directory. Represents the upper directory ~Represents the user’s […]

  • Several examples of Perl file operation

    Time:2019-5-26

    Perl uses the most places even file processing, below I summarize some things about Perl file operation, and there are specific examples, through the following examples, to enhance our understanding of Perl file operation. Delete files Use unlinke functions, such as unlink $file, unlink $file1, $file2, $file3 Open file Opening a file in the form […]

  • Summary of Document Operating Codes in Go Language

    Time:2019-4-20

    # Create and open files // New files can be created in two ways: func Create(name string) (file *File, err Error) Create a new file according to the file name provided, and return a file object. The default permission is 0666 file. The returned file object is readable and writable. func NewFile(fd uintptr, name string) […]

  • Summary of PHP File Operation Examples [File Upload, Download, Paging]

    Time:2019-4-19

    This article gives an example of PHP file operation. Share for your reference, as follows: 1. File upload Upload domain:input type=”file” Ordinary text boxes (text, password, textarea, radio, checkbox, etc.): Submit data to the server in the form of byte streams File: Submitting a file in binary encoding to the past is very simple to […]

  • Document Operation of Perl Learning Notes

    Time:2019-3-29

    Perl’s operations on files are similar to those in other languages. They are just open, read and write operations. 1. Open the file #! c:/perl/bin/perl -w use utf8; use strict; use warnings; My $filename =’test.txt’; # or using absolute paths, such as: c:/perl/Learn/test.txt If (open (MYFILE, $filename)# MYFILE is a flag { printf “Can open […]

  • Summary of Common Methods of File Directory Operation in Erlang IO Programming

    Time:2019-3-29

    Erlang‘s modules for manipulating file I/O are: File module: The methods of opening, reading, writing and closing the directory where the file has been operated are basically here. Filename module: Provides a platform-independent way to manipulate file names Filelib Module: Extension of File Module, which provides more practical tools to build on File Module IO […]