Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » file manipulation » fileMode » fileMode(ZZ,File)
next | previous | forward | backward | up | index | toc

# fileMode(ZZ,File) -- set file mode

- Function: fileMode
- Usage:
    `fileMode(mo,f)`
- Inputs:
  - mo, an integer
  - f, a file
- Consequences:
  - the mode of the open file f is set to mo

## Description

    i1 : fn = temporaryFileName()

    o1 = /tmp/M2-28898-0/0

    i2 : f = fn << "hi there"

    o2 = /tmp/M2-28898-0/0

    o2 : File

    i3 : m = 7 + 7*8 + 7*64

    o3 = 511

    i4 : fileMode(m,f)

    i5 : fileMode f

    o5 = 511

    i6 : close f

    o6 = /tmp/M2-28898-0/0

    o6 : File

    i7 : fileMode fn

    o7 = 511

    i8 : removeFile fn

## Ways to use this method:

- fileMode(ZZ,File) -- set file mode

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_system.m2:1333:0.