Manage PlItems

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search
Displaying 71-80 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
166PythonFilehandlingDatei auf dem Betriebssystem ausführenimport commands output=commands.getoutput("dir") print output # home tmp myFile.shView Update Delete
175Bash ScriptFilehandlingVerzeichnis rekursiv durchsuchen# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#Variablen-Teil-2 #!/bin/bash for file in /home/myUser/*/*.png ; do echo "Diese Datei: $file" fname=$(basename "$file") echo "hat den Namen: $fname" fdir=$(dirname "$file") echo "und steht im Verzeichnis: $fdir" # Diese Datei: /home/myUser/galaxy.png # hat den Namen: galaxy.png # und steht im Verzeichnis: /home/myUser View Update Delete
176Bash ScriptFilehandlingPrüfen ob Datei existiert# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#If-Else-Anweisung #!/bin/bash filePath="/home/myUser/test.txt" if [ -f ${filePath} ] then echo "There it is! ;-)" else echo "Whow, file is missing at this place :-(" fiView Update Delete
177DelphiFilehandlingPrüfen ob Datei existiertprocedure TForm1.CheckIfFileExists(); var filePath : String; begin filePath:='C:\User\myUser\text.txt'; if FileExists(filePath) then begin ShowMessage('There it is! ;-)'); end else begin ShowMessage('Whow, file is missing at this place :-('); end; end;View Update Delete
178C#FilehandlingPrüfen ob Datei existiertString filePath = "C:\\User\\myUser\\text.txt"; if (System.IO.File.Exists(filePath)) { MessageBox.Show("There it is! ;-)"); } else { MessageBox.Show("Whow, file is missing at this place :-("); }View Update Delete
179PHPFilehandlingPrüfen ob Datei existiert$filePath = "/home/myUser/test.txt"; if (file_exists($filePath)) { echo "There it is! ;-)" } else { "Whow, file is missing at this place :-(" }View Update Delete
184BatchFilehandlingPrüfen ob Datei existiert@echo off SET checkFileExists="C:\Temp\myFile.txt" IF exist %checkFileExists% GOTO :EXISTS GOTO :EXISTSNOT :EXISTS echo There it is :-) GOTO :END :EXISTSNOT echo Sorry, the file isn't there :-( GOTO :END :END echo End of programView Update Delete
192PythonFilehandlingPrüfen ob Datei existiertimport os filePath="/home/myUser/test.txt" if (os.path.isfile(filePath)): print "There it is! ;-)" else: print "Whow, file is missing at this place :-(" View Update Delete
194PythonFilehandlingFilename-Manipultation Basicsimport os myFilename = "/tmp/Test/myFile.txt" # Get only the path path_only = os.path.dirname(myFilename) # /tmp/Test # Filename only filename_only = os.path.basename(myFilename) # myFile.txt # get only filename without extention filename_without_ext = os.path.basename(os.path.splitext(myFilename)[0]) # myFile # get only the extension filename_extention_only = os.path.splitext(myFilename)[1] # .txt # put them together again myFilename_together = os.path.join(path_only, filename_without_ext + filename_extention_only) # /tmp/Test/myFile.txt View Update Delete
203JavaFilehandlingTernary operatorString thisVar = "OK"; boolean resultVar; resultVar = thisVar.equals("OK") ? true : false; // same as if-else construction if (thisVar.equals("OK")) { resultVar = true; } else { resultVar = false; }View Update Delete