Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
LINUX系統程式設計 第二版
by
Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from
LINUX系統程式設計 第二版
緩衝式
I/O
|
89
取得當前串流位置
不同於
lseek()
,
fseek()
並不會傳回更新過的位置。因此另外提供了一個介面。
ftell()
函式可用於傳回
stream
的當前串流位置:
#include <stdio.h>
long ftell (FILE *stream);
發生錯誤時,它會傳回
-1
並把
errno
設定成適當的值。
此外,標準
I/O
程式庫還提供了
fgetpos()
:
#include <stdioh.h>
int fgetpos (FILE *stream, fpos_t *pos);
執行成功時,
fgetpos()
會傳回
0
並把
stream
的當前串流位置放入
pos
。執行失敗時,則
會傳回
-1
並把
errno
設定成適當的值。如同
fsetpos()
,之所以會提供
fgetpos()
只是因
為非
Linux
平台具有複雜的檔案位置資料型別。
出清一個串流
標準
I/O
程式庫提供了一個介面,可用於把用戶緩衝區寫出到核心,以確保經由
write()
寫入至串流的所有資料得以被出清。
fflush()
函式便提供了此一功能:
#include <stdio.h>
int fflush (FILE *stream);
調用此函式時,
stream
所指向之串流中任何未被寫出的資料,會被出清至核心。如果
stream
為
NULL
,行程中所開啟的所有輸入串流均會被出清。執行成功時,
fflush()
會傳
回
0
。執行失敗時,則會傳回
EOF
並把
errno
設定成適當的值。
欲瞭解
fflush()
所造成的影響,你必須瞭解「
C
程式庫所維護的緩衝區」與「核心自己 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
優雅的SciPy|Python科學研究的美學
Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
成為卓越程式設計師的38項必修法則
Pete Goodliffe
深入理解運算原理|從簡單的機器到無所不能的程式
Tom Stuart
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9789862769812