|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 23.98 GB of 70.42 GB (34.05%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
share/
pyshared/
landscape/
lib/
- drwxr-xr-x
|
Viewing file: fs.py (1.04 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
"""File-system utils"""
import os
def create_file(path, content): """Create a file with the given content.
@param path: The path to the file. @param content: The content to be written in the file. """ fd = open(path, "w") fd.write(content) fd.close()
def read_file(path, limit=None): """Return the content of the given file.
@param path: The path to the file. @param limit: An optional read limit. If positive, read up to that number of bytes from the beginning of the file. If negative, read up to that number of bytes from the end of the file. @return content: The content of the file, possibly trimmed to C{limit}. """ fd = open(path, "r") if limit and os.path.getsize(path) > abs(limit): whence = 0 if limit < 0: whence = 2 fd.seek(limit, whence) content = fd.read() fd.close() return content
def touch_file(path): """Touch a file, creating it if it doesn't exist.""" fd = open(path, "a") fd.close() os.utime(path, None)
|