Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Programa: Criando arquivos e pastas em linguagem C
- * Data de criação: 07/12/2015
- * Autor: Eric Cancellgliere (http://programacaoemfoco.com.br)
- * Versão: 1.0
- * Última modificação em [07/12/2015] feita por [Eric Cancellgliere]
- */
- //bibliotecas
- #include <stdio.h>
- #include <stdlib.h>
- #include <locale.h>
- #include <windows.h>
- int main(void){
- //comando de regionalização
- setlocale(LC_ALL, "Portuguese");
- //título do programa
- SetConsoleTitle("Criando arquivos e pastas");
- //system ("mkdir Aulas");
- //NOME DO ARQUIVO | SEGURANÇA
- if (CreateDirectory ("Aulas", NULL)){
- printf ("Pasta criada com sucesso!\n\n");
- }
- else
- {
- printf ("Erro ao criar a pasta.\n\n");
- }
- //system ("copy NUL Aulas\\texto.txt");
- //NOME DO ARQUIVO | TIPO DE ACESSO | COMPARTILHAMENTO | SEGURANÇA | TIPO DE CRIAÇÃO DO ARQUIVO | ATRIBUTOS | TEMPLATE PARA ARQUIVO
- if (CreateFile ("Aulas/texto.txt", GENERIC_READ, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL)){
- printf ("Arquivo criado com sucesso!\n\n");
- }
- else
- {
- printf ("Erro ao criar o arquivo.\n\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement