PT-BR/fileGetPath: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{BR/Funcao compartilhada}} {{PT-BR/New feature/item|3.0153|1.5.3|7446| Esta função retorna o caminho de um determinado arquivo. }} ==Sintaxe== <syntaxhighlight lang="lua"> string fileGetPath ( file theFile ) </syntaxhighlight> {{PT-BR/POO||file:getPath|path}} ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que você quer obter o caminho. ===Retorno=== Retorna uma ''string'' representando o caminho do arquivo, ''false'' se um arquivo inv...") |
(No difference)
|
Latest revision as of 18:43, 20 December 2023
Esta função retorna o caminho de um determinado arquivo.
Sintaxe
string fileGetPath ( file theFile )
Sintaxe POO(OOP) Não entendeu o que significa isso?
- Método: file:getPath(...)
- Variável: .path
Argumentos necessários
- theFile: O arquivo que você quer obter o caminho.
Retorno
Retorna uma string representando o caminho do arquivo, false se um arquivo inválido estiver sido especificado.
Exemplo
Click to collapse [-]
Exemplo 1local newFile = fileCreate("test.txt") -- tentamos criar um arquivo if (newFile) then -- verificamos se o arquivo foi criado local path = fileGetPath(newFile) outputChatBox("New file created at: "..path, root, 0, 255, 0) fileClose(newFile) -- fechamos o arquivo depois que trabalharmos com ele end
Veja também
- fileClose
- fileCopy
- fileCreate
- fileDelete
- fileExists
- fileFlush
- fileGetPath
- fileGetPos
- fileGetSize
- fileIsEOF
- fileOpen
- fileRead
- fileRename
- fileSetPos
- fileWrite