LucasJPA
(usa Debian)
Enviado em 20/05/2017 - 11:38h
Caros tenho uma duvida quero apagar os caracteres das linhas de um arquivos, mas tenho duvida pois não programo muito com arquivos em C, fiquei me perguntando se as funçoes fputc e fgetc funcionariam pra isso
o conteudo do arquivo e este:
execve("/bin/pwd", ["pwd"], [/* 46 vars */]) = 0
brk(0) = 0x10ee000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc28dd6f000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106478, ...}) = 0
mmap(NULL, 106478, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc28dd55000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\34\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1738176, ...}) = 0
mmap(NULL, 3844640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc28d7a6000
mprotect(0x7fc28d947000, 2097152, PROT_NONE) = 0
mmap(0x7fc28db47000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a1000) = 0x7fc28db47000
mmap(0x7fc28db4d000, 14880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc28db4d000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc28dd54000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc28dd53000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc28dd52000
arch_prctl(ARCH_SET_FS, 0x7fc28dd53700) = 0
mprotect(0x7fc28db47000, 16384, PROT_READ) = 0
mprotect(0x606000, 4096, PROT_READ) = 0
mprotect(0x7fc28dd71000, 4096, PROT_READ) = 0
munmap(0x7fc28dd55000, 106478) = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1863120, ...}) = 0
mmap(NULL, 1863120, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc28db8b000
close(3) = 0
brk(0) = 0x10ee000
brk(0x110f000) = 0x110f000
getcwd("/home/lucas/Documentos/SO", 4096) = 26
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc28dd6e000
write(1, "/home/lucas/Documentos/SO\n", 26) = 26
close(1) = 0
munmap(0x7fc28dd6e000, 4096) = 0
close(2) = 0
exit_group(0) = ?
+++ exited with 0 +++
e a chamada do comando strace pwd, e quero apagar os caracteres das linhas a partir do primeiro "(" parentese ate a quebra de linha, "\n", para deixar somente as chamadas de sistema, como o fstart, mmap, close. Lembrando que esse e o conteudo de um arquivo entao queria saber como posso fazer isso em C.
obrigado pela ajuda de todos