Function Reference: Volume 2 (F-O) - The MathWorks - #401

/ 1568


catalogue search
P. 401
P. 402
P. 403
P. 404
P. 405
P. 406
P. 407
P. 408
P. 409
P. 410
P. 411
P. 412
P. 413
P. 414
P. 415
P. 416
P. 417
P. 418
P. 419
P. 420
P. 421
P. 422
P. 423
P. 424
P. 425
P. 426
P. 427
P. 428
P. 429
P. 430
P. 431
P. 432
P. 433
P. 434
P. 435
P. 436
P. 437
P. 438
P. 439
P. 440
P. 441
P. 442
P. 443
P. 444
P. 445
P. 446
P. 447
P. 448
P. 449
P. 450


See other catalogues for The MathWorks

Text version of the page
ftell
Purpose File position indicator
Syntax position = ftell(fid)
Description position = ftell(fid) returns the location of the file position
indicator for the file specified by fid, an integer file identifier obtained from fopen.The position is a nonnegative, zero-based integer specified in bytes from the beginning of the file. A returned value of -1 for position indicates that the query was unsuccessful; use ferror to determine the nature of the error.
Remarks ftell is likely to return an invalid position when all of the following
aretrue. This is duetothe wayinwhich theMicrosoft® Windows® C library currently handles its ftell and fgetpos commands:
• The file you are currently operating on is an ASCII text file.
• The file was written on a UNIX-based system, or uses the UNIX-style line terminator: a line feed (with no carriage return) at the end of each line of text. (This is the default output format for MATLAB® functions dlmwrite and csvwrite.)
• You are reading the file on a Windows system.
• You opened the file with the fopen function with mode set to 'rt\
• The ftell command is directly preceded by an fgets or fgetl command.
Note that this does not affect the ability to accurately read from and write to this type of file from MATLAB.
See Also fclose, ferror, fopen, fprintf, fread, fscanf, fseek, fwrite
2-1345

pageCatalog pdf di En 2012-06-22-01